question

JohnsonAveretteThomasW-1645 avatar image
1 Vote"
JohnsonAveretteThomasW-1645 asked ·

How do I resolve Access Denied error when trying to deploy Echobot in Azure?

Duplicate of post on Stack Overflow: https://stackoverflow.com/questions/62760206/how-do-i-resolve-access-denied-error-when-trying-to-deploy-echobot-in-azure

I had a operating bot that I tried to push an update to and got a failure response. I tried building and deploying in Kudu with no luck either. Just as a sanity check I also made a brand new echobot on Azure and tried to run the build and deploy commands in Kudu Console.

EDIT: Meant to mention I've seen a few other mentions of similar issues including: Error - Access is denied - deployment to Azure App Services https://github.com/projectkudu/kudu/issues/3177 https://medium.com/rare-crew/hot-issue-on-azure-and-deployment-of-apps-by-kudu-scripts-dotnet-sdk-v3-1-301-92d6e336756a

EDIT2: Twitter thread asking for support: https://twitter.com/AzureSupport/status/1280172789085999105

MSBUILD : error MSB1025:Unhandled exception. An internal failure occurred while running MSBuild.
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)
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)
Failed exitCode=-532462766, command=dotnet restore "EchoBot.sln"
An error has occurred during web site deployment.

azure-bot-service
· 10
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have the same trouble, but I fixed it with this https://medium.com/rare-crew/hot-issue-on-azure-and-deployment-of-apps-by-kudu-scripts-dotnet-sdk-v3-1-301-92d6e336756a, with a change, I saved the global.json in D:\home\site\wwwroot\global.json, and it works perfectly.

1 Vote 1 ·

is the D:\home\site\wwwroot folder in Azure? If so, how can you get there?

0 Votes 0 ·

Hello!!

I got there using the debug console:

11478-captura.png


0 Votes 0 ·
captura.png (30.5 KiB)

I figured it out.

-1 Vote -1 ·

@JohnsonAveretteThomasW-1645 Could you please try the following workaround in your deploy.cmd.


SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild-16.4\MSBuild\Current\Bin\MSBuild.exe


call :ExecuteCmd "%MSBUILD_PATH%" -t:Restore "%DEPLOYMENT_SOURCE%\my-solution.sln"


call :ExecuteCmd "%MSBUILD_PATH%" -t:Publish "%DEPLOYMENT_SOURCE%\vstar-next\my-proj.csproj" -p:OutputPath="%DEPLOYMENT_TEMP%" -p:Configuration=Dev


0 Votes 0 ·

I'm trying to reply with the resulting output but it will not let me submit and gives no feedback to why I can't submit.

0 Votes 0 ·

Here are the original lines with the changes you suggested. (This is in the default EchoBot project automatically generated by Azure.)

::SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe
SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild-16.4\MSBuild\Current\Bin\MSBuild.exe

::call :ExecuteCmd dotnet restore "EchoBot.sln"
call :ExecuteCmd "%MSBUILD_PATH%" -t:Restore "%DEPLOYMENT_SOURCE%\EchoBot.sln"

::call :ExecuteCmd dotnet publish "EchoBot.csproj" --output "%DEPLOYMENT_TEMP%" --configuration Release
call :ExecuteCmd "%MSBUILD_PATH%" -t:Publish "%DEPLOYMENT_SOURCE%\vstar-next\EchoBot.csproj" -p:OutputPath="%DEPLOYMENT_TEMP%" -p:Configuration=Dev

0 Votes 0 ·

Build fails with the following error:
D:\home\site\wwwroot\EchoBot.sln.metaproj : error MSB4057: The target "Restore" does not exist in the project. [D:\home\site\wwwroot\EchoBot.sln]
Done Building Project "D:\home\site\wwwroot\EchoBot.sln" (Restore target(s)) -- FAILED.

0 Votes 0 ·

this may be a stupid question, but I have no MSBuild-16.4 folder locally in the path you listed above. What is the easiest way to get it?

I tried using this path, but still had issues: SET MSBUILD_PATH=%Program Files (x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe

0 Votes 0 ·

The global.json solution below actually worked for me.

0 Votes 0 ·

1 Answer

MichaelStr avatar image
3 Votes"
MichaelStr answered ·

Hi!
I faced the same problem as you today. I just wanted to build a simple QnA chatbot and it didn't work out like i expected. Basically I was able to solve the issue with one of the threads you already linked. https://medium.com/rare-crew/hot-issue-on-azure-and-deployment-of-apps-by-kudu-scripts-dotnet-sdk-v3-1-301-92d6e336756a
It seems, that there is some error in the current sdk version.
So what I did was; I reverted all my changes in the deploy.cmd and created a global.json file (i just used the App Serices editor and its console; touch global.json and used the editor to modify it)
I currently used msbuild 3.1.301 (dotnet --version) and in the tutorial was suggested to use version 3.1.202. I didn't have that one installed and didn't find a way to do so.
But dotnet --list-sdks showed, that I have 2.2.109 installed, so i decided to give it a try. The global json is now:
{
"sdk": {
"version": "2.2.109"
}
}
Saved it and called build.cmd again. This time it worked fine. I guess we gotta wait for a fix there. Hopefully it works for you as well!

· 4 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MichaelStr Thanks.The issue is recently introduced by latest dotnet sdk (2.1.515 and 3.1.301) versions. This impacts the projects with custom deployment script still using dotnet restore and publish to build.The code generators for bots published on github.
We have forwarded to the product team for the fix, will update once the fix roll- out.



1 Vote 1 ·

Close to the correct answer for the Echobot problem. Creating a global.json file in "D:\home\site\wwwroot" with the below finally let the deploy run correctly. This worked for my existing bot as well. Thanks for the help. I think I got misdirected by another thread I found that said to put he global.json into "D:\home\site\repository" which is incorrect.

 {
 "sdk": {
 "version": "3.1.202"
 }
 }
1 Vote 1 ·
EvangelosPoulios-2864 avatar image EvangelosPoulios-2864 JohnsonAveretteThomasW-1645 ·

I tried to alter the dotnet version with the global.json. However when i run az webappyment source config-zip --resource-group ...

i still get

 [Errno 13] Permission denied: 'C:\\Users\\Vag\\Dropbox\\OTHER\\M HCI\\thesis\\4. tutorial and import data\\14.nlp-with-dispa
 Traceback (most recent call last):
   File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-yccaebu4\knack\cli.py", line 233, in invoke
 ...

Does anyone else meet such a case?






0 Votes 0 ·

My issue was related to a known problem from an update they made to their platform which was eventually resolved, so that shouldn't be affecting anyone anymore. My only input is to just make sure you have the files in the correct directories and that those directories can be accessed by your application.

0 Votes 0 ·