Deploy to Azure not working for .NET 5 GitHub application - MSBuild.exe is not recognized as an internal or external command

Michael Washington 921 Reputation points MVP
2020-12-04T01:33:26.277+00:00

When I use the Deploy To Azure button from this page:
https://github.com/Azure/azure-quickstart-templates/tree/master/201-web-app-github-deploy

Configure it to pull the content of my .NET 5 application at:
https://github.com/ADefWebserver/Blazor-Blogs.git

44994-image.png

I get the following error:

44954-image.png

44977-image.png

Command: "C:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment with MSBuild16.7.0.
'"\MSBuild.exe"' is not recognized as an internal or external command,
operable program or batch file.
Failed exitCode=1, command="\MSBuild.exe" /restore "C:\home\site\repository\BlazorBlogs\BlazorBlogs.csproj" /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="C:\local\Temp\8d897f1154b7e49"
An error has occurred during web site deployment.
'"\MSBuild.exe"' is not recognized as an internal or external command,\r\noperable program or batch file.\r\nC:\Program Files (x86)\SiteExtensions\Kudu\90.21106.4900\bin\Scripts\starter.cmd "C:\home\site\deployments\tools\deploy.cmd"

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Washington 921 Reputation points MVP
    2020-12-04T17:44:26.95+00:00

    I can confirm that adding:
    "netFrameworkVersion": "v5.0"
    fixes the issue:
    https://github.com/oqtane/oqtane.framework/pull/975/commits/1b017a96515a45266d1890923b65dbc62e53e7ff

    45230-image.png


1 additional answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2020-12-04T04:48:42.163+00:00

    Hi @Michael Washington ,

    I did hit the same error you did. I'm not certain what caused the build in deployment center to fail. It could be the fact this template creates a .NET47 runtime. I was, however, able to get around it by changing the runtime to .NETCore 5, disconnecting your git repo and re-add it in deployment center. I'll have to investigate why the template fails and update this post with my findings.

    Regards,
    Ryan


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.