在函数应用设置中配置WEBSITE_LOAD_USER_PROFILE为1
示例代码:
1.在 functions 应用设置中添加 WEBSITE_LOAD_USER_PROFILE,并将其设置为 1。
2.在函数代码中添加以下行:
using System.Diagnostics; // ... var process = new Process() { StartInfo = new ProcessStartInfo { FileName = "cmd.exe", Arguments = "/C set", RedirectStandardOutput = true, UseShellExecute = false, CreateNoWindow = true, } }; process.Start(); process.BeginOutputReadLine(); process.OutputDataReceived += (sender, eventArgs) => { log.LogInformation(eventArgs.Data); };
上一篇:Azure函数的侦听器无法启动-Microsoft.Azure.EventHubs.Processor遇到错误。
下一篇:Azure函数durable-Microsoft.Azure.WebJobs.Extensions.DurableTask:值不能为空(参数'hostConfiguration')