Welcome to Shaun Luttin's public notebook. It contains rough, practical notes. The guiding idea is that, despite what marketing tells us, there are no experts at anything. Sharing our half-baked ideas helps everyone. We're all just muddling thru. Find out more about our work at bigfont.ca.

Azure CLI Commands

Tags: azure, azure-cli

Delete a web app

azure webapp delete -g <resourceGroup> -n <webAppName>

List existing web apps

azure webapp list -g <resourceGroup> --json

Delete a server farm The challenge is to know the API version to use.

azure resource delete -g <resourceGroup> -n <farmName> -r Microsoft.Web/serverFarms -o 2015-08-01 -q

List existing resources

azure resource list -g <resourceGroup> --json

Run a resource group deployment template The -vv shows useful troubleshooting info.

azure group deployment create -f .\<fileName>.json -g <resourceGroup> -vv

To delete existing resources that are not in the template, use the -m complete mode not the default -m incremental mode.

Resource Condition                   Incremental   Complete

are in the resource group            Do nothing    Delete
NOT in the template

are in the template                  Add           Add
NOT in the resource group

are in the same condition            Do nothing    Do nothing
in the resource group and template   

List website related commands

azure provider operations show Microsoft.Web/sites/*