1
votes

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?

2
Have a look at the CLI Reference on the Azure Websites Cheat Sheet. Looks like something like azure site defaultdocument add app_offline.htm - rickvdbosch
Have you try my command? - Joy Wang
@JoyWang sorry, currently doing something else, but I will check. - GrimSmiler
@JoyWang sorry to keep you waiting, you solution exactly what i wanted! thanks! - GrimSmiler
@JoyWang done! :) - GrimSmiler

2 Answers

3
votes

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

0
votes

Changing that setting is not currently possible in Azure CLI 2.0, but it would be great if you could file an issue here (better when it comes from customers).

However, you can use Azure PowerShell to achieve this today.

$webapp = Get-AzureRmWebApp -ResourceGroupName rg -Name name
$webapp.SiteConfig.DefaultDocuments.Add("new.html")
Set-AzureRmWebApp $webapp