【发布时间】:2020-04-03 06:54:48
【问题描述】:
我正在尝试通过提供用户的用户名和密码,使用 Process.Start 命令在 azure function (v2) 中运行可执行文件
string nwPath = <path/to/bla.exe>
string dirName = Path.GetDirectoryName(nwPath);
var processInfo = new ProcessStartInfo()
{
WorkingDirectory = dirName,
FileName = nwPath,
UserName = <username>,
Password = secureString,
Domain = <domain>,
UseShellExecute = false,
Arguments = @"p1 p3",
Verb = "runas"
};
Process.Start(processInfo);
此函数使用传入的用户名和密码在本地运行。当我将它部署到天蓝色时,我收到以下错误 访问被拒绝
我已经通过点击上传按钮上传了azure函数中的可执行文件,可执行文件路径是
C:\home\wwwroot\functionname\bla.exe
如果我使用以下命令运行该进程,它将在 azure 上运行
Proccess.Start(@"path/to/bla.exe")
我假设在用户下运行的进程无权访问可执行文件。
我们可以授予用户访问 azure 函数中的可执行文件的权限吗?
【问题讨论】:
标签: azure-functions