Az CLI Commands - CMDsheet
Shell
- Get a single column from an array:
1
az ad app list --query "[].displayName"
- Get multiple columns from an array
1
az ad app list --query "[].{Name:displayName, Created:createdDateTime}"
- Filter the az command output and select specfic attribute:
1 2
az network public-ip list -g resourceGroupName --query "[?name=='publicIpResourceName'].ipAddress az network vnet list --query "[?name=='vnet1'].subnets[].addressPrefix"
- Az Login with a Service Principal
1 2
az account set --subscription "<subscription ID or name>" az login --service-principal -u <app-id> -p <password-or-cert> --tenant <tenant>
This post is licensed under CC BY 4.0 by the author.