Search code examples
azureazure-web-app-serviceazure-cliazure-cli2

Azure CLI. Is it possible to update/set default documents for web app?


I have a web app on azure and i want to add a value app_offline.htm in Default Documents through azure cli 2.0: enter image description here

I looked at az webapp config appsettings set, but this sets the config and not the default document.

Did someone encounter this?
Is there a solution to doing this through CLI and not manually through Azure UI?


Solution

  • Of course you can.

    You could try the command below, replace the <yourresourcegroup> and <yourwebappname>, it works fine on my side.

    az resource update --resource-group <yourresourcegroup> --resource-type "Microsoft.Web/sites/config" --name <yourwebappname>/config/web --add properties.defaultDocuments app_offline.htm
    

    enter image description here