asp.netlinuxazureazure-web-app-servicekudu

Deploying to Azure App Service Linux - "dotnet: command not found"


I have created a new Linux App Service (Web App) on Azure. I have set the .NET version to 6. When I try to deploy via local Git I get the following error:

deploy.sh: line 84: dotnet: command not found

If I change the version of .NET to 3.1, and check if .NET is installed via Kudu I can see that .NET is installed. However I can not use version 3.1 for my app.

How do I get a Linux App Service with .NET 6 installed correctly?


Solution

  • Solution

    The project in question was using a custom Kudu deploy script which ran during deployment fine when using a Windows App Service. However I would get the above error when it ran on Linux. Linux uses Oryx to perform the build, and I believe the Kudu custom script was running in place of the default Oryx script.

    The solution for me was to remove the custom script so that the default Oryx deploy script ran. The Oryx script handled the installation of dotnet and the build and deploy succeeded.

    Oryx allows a custom script post build which I may use to replace the extra build steps that I previously had in a Kudu script.