Search code examples
.netazureazure-web-app-serviceazure-appservice

How to customize the startup command for Azure app service?


I am using Azure app service to deploy a .NET 6.0 website, running in a Windows-based environment. It seems like they use MSBuild as a default startup command. I am just wondering how to customize the startup command via the Azure web console or any config file. Since I couldn't find the "Startup command" field under "Configurations" > "General Settings", the field mentioned in this post is missing. enter image description here


Solution

  • I couldn't find the "Startup command" field under "Configurations" > "General Settings"

    The option to add the Startup command in General Settings is available only for the Azure App Services deployed in Linux Environment.

    enter image description here

    • You can see the MSDoc's 1 and 2 explains the way to add a startup for only Linux Apps.

    customize the startup command to dotnet build & dotnet publish

    • As I have mentioned in the comments, the app deployed in Windows App service contains the web.config file with default settings (processPath=dotnet).
    <aspNetCore processPath="dotnet" arguments=".\Startup28Feb.dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" hostingModel="inprocess" />
    
    • Even the MSDoc, says the same.

    The generated web.config is tailored to the detected start script

    • Make sure the app is deployed properly and contains all the files in the KUDU Console.

    enter image description here

    AFAIK,the .NET Core App deployed in Windows Environment does not require any startup command to set manually to run the Application.