问题
We use automatic deployment process in Azure by KUDU scripts and by today we see strange error in Azure deployment center:
Command dotnet publish (and also 'dotnet build') returns:
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Unhandled exception. System.ComponentModel.Win32Exception (5): Access is denied.
System.ComponentModel.Win32Exception (5): Access is denied.
at System.Diagnostics.Process.set_PriorityClassCore(ProcessPriorityClass value)
at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
at System.Diagnostics.Process.set_PriorityClassCore(ProcessPriorityClass value)
at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Failed exitCode=-532462766, command=dotnet publish "D:\home\site\repository\
...
Details:
- there is automatic deployment process by KUDU script
- app is .NET Core application, .csproj has target framework: netcoreapp2.2
Issue probably will be on Azure side, because we did't do any bigger change in the project. Has anybody same/similar issue?
回答1:
We had the same issue and after investigation we found that:
- Azure applied new 'dotnet' version 3.1.301 and this version of SDK throws that error (your version you can check by commnad 'dotnet --version')
- by command 'dotnet --list-sdks' you can see all installed SDKs
- then we simple used previous version (in our case v3.1.202)
- the easiest way how to tell exact version of dotnet sdk is by global.json
Example: global.json
{
"sdk": {
"version": "3.1.202"
}
}
And file must be in 'working directory', and KUDU script has working directory here D:\home\site\repository
When your deployment was OK on previous version of dotnet SDK, than this should definitely help.
来源:https://stackoverflow.com/questions/62595408/error-access-is-denied-deployment-to-azure-app-services