1

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?

GrimSmiler
  • 561
  • 1
  • 4
  • 21

2 Answers2

3

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

Joy Wang
  • 39,905
  • 3
  • 30
  • 54
0

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
twitchax
  • 815
  • 6
  • 14