Asp.net core 使用Kudu生成服务部署asp.net核心应用程序时获取UnauthorizedAccessException

Asp.net core 使用Kudu生成服务部署asp.net核心应用程序时获取UnauthorizedAccessException,asp.net-core,azure-web-app-service,kudu,Asp.net Core,Azure Web App Service,Kudu,我已经使用Kudu构建服务(通过GitHub直接连接)设置了我的aspnet core 2.2应用程序的连续部署。直到前天还不错,但从昨天开始,当我尝试部署任何东西时,开始出现UnauthorizedAccessException。但我的申请没有任何变化。你知道这里有什么问题吗 以下是详细的例外情况: 命令:“D:\home\site\deployments\tools\deploy.cmd” 处理ASP.NET核心Web应用程序部署。 System.UnauthorizedAccessExce

我已经使用Kudu构建服务(通过GitHub直接连接)设置了我的aspnet core 2.2应用程序的连续部署。直到前天还不错,但从昨天开始,当我尝试部署任何东西时,开始出现
UnauthorizedAccessException
。但我的申请没有任何变化。你知道这里有什么问题吗

以下是详细的例外情况:

命令:“D:\home\site\deployments\tools\deploy.cmd”
处理ASP.NET核心Web应用程序部署。
System.UnauthorizedAccessException:试图执行未经授权的操作。
位于Internal.Win32.RegistryKey.Win32Error(Int32 errorCode,String str)
位于Internal.Win32.RegistryKey.SetValue(字符串名称,字符串值)
位于System.Environment.SetEnvironmentVariableFromRegistry(字符串变量、字符串值、布尔值fromMachine)
失败的exitCode=1,command=dotnet还原“D:\home\site\repository\myproject.sln”
位于System.Environment.SetEnvironmentVariable(字符串变量、字符串值、EnvironmentVariableTarget)
网站部署期间发生错误。
位于Microsoft.DotNet.Cli.Utils.EnvironmentProvider.SetEnvironmentVariable(字符串变量、字符串值、环境变量目标)
在Microsoft.DotNet.ShellShim.WindowsEnvironmentPath.AddPackageExecutablePathToUserPath()中
在Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.Configure()中
在Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(IFirstTimeUseNoticesEntel firsttimeUseNoticesEntel、IASPNetCertificateSEntel AspNetCertificateSEntel、IFileSentinel toolPathSentinel、Boolean HassuperAccess、DotnetFirstRunConfiguration、IEnvironmentProvider environmentProvider Environment Provider)
位于Microsoft.DotNet.Cli.Program.ProcessArgs(字符串[]args,ITelemetry遥测客户端)
位于Microsoft.DotNet.Cli.Program.Main(字符串[]args)
System.UnauthorizedAccessException:试图执行未经授权的操作。\r\n在内部.Win32.RegistryKey.Win32错误(Int32 errorCode,String str)\r\n在内部.Win32.RegistryKey.SetValue(字符串名称,字符串值)\r\n在System.Environment.SetEnvironmentVariableFromRegistry(字符串变量,字符串值,布尔fromMachine)\r\n位于System.Environment.SetEnvironmentVariable(字符串变量、字符串值、环境变量目标)\r\n位于Microsoft.DotNet.Cli.Utils.EnvironmentProvider.SetEnvironmentVariable(字符串变量、字符串值、环境变量目标)\r\n位于Microsoft.DotNet.ShellShim.WindowsEnvironmentPath.AddPackageExecutablePathToUserPath()\r\n位于Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.Configure()\r\n位于Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,IASPnetCertificateSentel AspnetCertificateSentel,IFileSentinel toolPathSentinel,Boolean hasSuperUserAccess,DotnetFirstRunConfiguration DotnetFirstRunConfiguration,IEnvironmentProvider environmentProvider)\r\n位于Microsoft.DotNet.Cli.Program.ProcessArgs(字符串[]args,ITelemetry遥测客户端)\r\n位于Microsoft.DotNet.Cli.Program.Main(字符串[]args)\r\nD:\Program Files(x86)\SiteExtensions\Kudu\86.20224.4450\bin\Scripts\starter.cmd“D:\home\site\deployments\tools\deploy.cmd”
在kudu内部尝试“dotnet restore--help”并收到相同的错误后,我意识到该错误与在kudu内部执行“dotnet restore”有关,而不是与我的应用程序有关。 查看与错误消息相关的代码后 我意识到我可以通过添加一个名为DOTNET\u ADD\u GLOBAL\u TOOLS\u TO\u PATH和值false的新应用程序设置来解决这个问题


之后,我可以像以前一样使用kudu部署我的应用程序。

由于您没有做任何更改,所以我的建议是确保代码正常,您可以先尝试断开Github,然后设置Github进行连续部署。哇,这些更改按预期工作。谢谢!!