For system, network and cloud administrators

How to set default Azure subscription using Azure CLI

In order to make a particular Azure subscription as a default subscription, type:

az account set --subscription "yourAzuresubscriptionID"

How to set default Azure resource group using Azure CLI

In order to set a default Azure resource group, type:

az configure --defaults group="yourresourcegroup"

How to list all Azure SKUs that contain a pattern using Azure CLI?

In order to view all SKUs that contain Standard_D2s in their name, for example, type:

az vm list-skus -o table --query "[?contains(name,'Standard_D2s')].name"

How to list all available Azure SKUs using the Azure CLI?

There are times when you need to know what are all the SKUs available in the Azure portal. In order to achieve that, use:

az vm list-skus

How to view an Azure resource group’s location using Azure CLI

In order to view a particular Azure resource group’s location, type in your shell:

az group show --resource-group yourresourcegroup --query location