Azure 应用服务 - 运行 自定义可执行文件

Azure App Service - run custom executable

我有一个 .NET Core 2.2 Web 应用程序,此解决方案中的一个功能是调用第 3 方 .exe 来完成一些工作

`ProcessStartInfo psi = new ProcessStartInfo(path_to_custom_exe_file, command_here)`

是否可以在 Azure App Service 中执行此操作,或者我应该考虑其他选择?

是的,只要您的 exe 文件没有 GUI,您就可以在 Azure web 中调用可执行文件。

我用下面的代码调用一个 cmd 文件:

 var processStartInfo = new ProcessStartInfo()
        {

            FileName = @"D:\home\test.cmd",
            RedirectStandardOutput = true,
            UseShellExecute = false
        };

        var process = Process.Start(processStartInfo);

        var streamReader = new StreamReader(process.StandardOutput.BaseStream);



        ViewData["Message"] = streamReader.ReadToEnd(); ;

        return View();