juusokarlstrom.com // iuuso

Nifty One-liners for Azure-cli Operations

I'll update this later when I find out more of these while playing with Azure-cli and Azure in general.

Microsoft Learn - How to query Azure CLI command output using a JMESPath query

Store Subscription Id in an env variable

Multiple different commands that you run require the default subscription id you have on as the default subscription.

$ SUBSCRIPTION=$(az account list --query "[].id" --output tsv)
$ echo $SUBSCRIPTION

#azure #azure-cli #cloud #tech