Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:\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?

like image 285
Tom Matt Avatar asked Jun 26 '20 13:06

Tom Matt


People also ask

How do I fix access denied in Visual Studio?

0x80070005 - Access Denied To work around this issue, coordinate with your system administrator or other IT professional to make sure that these processes don't lock Visual Studio files. The user who is trying to install Visual Studio doesn't have administrator credentials on the computer.

How do I deploy to the Azure App Service in Visual Studio?

Create or open an Azure cloud service project in Visual Studio. In Solution Explorer, right-click the project, and, from the context menu, select Convert > Convert to Azure Cloud Service Project. In Solution Explorer, right-click the newly created Azure project, and, from the context menu, select Publish.


1 Answers

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.

like image 119
Rare Crew Avatar answered Oct 21 '22 10:10

Rare Crew