Post

Az CLI Commands - CMDsheet

Shell

  1. Get a single column from an array:
    1
    
    az ad app list --query "[].displayName"
    
  2. Get multiple columns from an array
    1
    
    az ad app list --query "[].{Name:displayName, Created:createdDateTime}"
    
  3. 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"
    
  4. 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.