Info Gathering

List subscriptions for authenticated account

az account list

 

Get tenant id

az account list | jq '.[].tenantId'

 

Get subscription id

az cli:

az account list | jq '.[].id'

Powershell:

Get-AzSubscription

Resources:
Powershell docs
ClI docs

List tenants

az account tenant list

 

List Resource Groups by name

az group list | jq -r '.[].name'

Resource: https://docs.microsoft.com/en-us/cli/azure/group?view=azure-cli-latest

Set Subscription

az cli:

az account set -s <name or id>

Powershell:

Set-AzureSubscription -Id [Subscription ID]

Resources:
https://powerzure.readthedocs.io/en/latest/Requirements/requirements.html
https://stackoverflow.com/questions/38475104/azure-cli-how-to-change-subscription-default

List all VMs

az vm list

Resource: https://docs.microsoft.com/en-us/cli/azure/vm?view=azure-cli-latest