Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
601 views
in Technique[技术] by (71.8m points)

asp.net core - Error - Access is denied - deployment to Azure App Services

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:homesite
epository
...

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:homesite epository

When your deployment was OK on previous version of dotnet SDK, than this should definitely help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...