gpt4 book ai didi

sql-server - 从运行在不同虚拟机中的 ASP.NET MVC Web 应用程序执行 SSIS 包

转载 作者:行者123 更新时间:2023-12-03 00:31:35 27 4
gpt4 key购买 nike

同一个 Azure 帐户下运行着三个 Azure 虚拟机。

第一个虚拟机是第二个和第三个虚拟机的域 Controller 。

第二个 VM 具有 Windows Server 2012 R2 操作系统。此 VM 安装了 MS SQL Server 2014,并部署了所有 SSIS 包。某些 SSIS 包负责将某些文件从一个文件夹移动到附加(映射)到该 VM 的网络驱动器内的另一个文件夹。

第三个 VM 还具有 Windows Server 2012 R2 操作系统。该虚拟机正在运行 ASP.NET MVC Web 应用程序,它负责执行部署在第二个虚拟机中的 SSIS 包。

问题: Web 应用程序能够执行 SSIS 包,但文件无法从一个文件夹移动到另一文件夹。我查看了包执行日志,看到了一条警告消息,如下所示:

Foreach Loop Container:Warning: The For Each File enumerator is empty. The For Each File enumerator did not find any files that matched the file pattern, or the specified directory was empty.

这似乎是一些权限问题,但我无法确定真正的原因。

下面是我在 ASP.NET MVC Web 应用程序中使用的 SSIS 包执行 C# 代码来执行包:

// SSIS server object with connection
IntegrationServices ssisServer = new IntegrationServices(ssisConnection);
// The reference to the package which you want to execute
PackageInfo ssisPackage = ssisServer.Catalogs["SSISDB"].Folders[folderName].Projects[projectName].Packages[packageName];
// Add execution parameter to override the default asynchronized execution. If you leave this out the package is executed asynchronized
Collection<PackageInfo.ExecutionValueParameterSet> executionParameter = new Collection<PackageInfo.ExecutionValueParameterSet>();
executionParameter.Add(new PackageInfo.ExecutionValueParameterSet { ObjectType = 50, ParameterName = "SYNCHRONIZED", ParameterValue = 1 });
// Get the identifier of the execution to get the log
long executionIdentifier = ssisPackage.Execute(false, null, executionParameter);

注意:如果我直接从 SQL Server Management Studio 执行 SSIS 包,那么它会按预期工作(移动文件和其他内容)。

最佳答案

在 IIS 中,对于要将 ASP.NET MVC Web 应用程序部署到的网站,检查它属于哪个应用程序池以及应用程序池的标识。用作应用程序池标识的帐户需要对您尝试访问和移动的路径具有文件系统级别的权限。

关于sql-server - 从运行在不同虚拟机中的 ASP.NET MVC Web 应用程序执行 SSIS 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38302763/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com