The knowledge base / All cheat sheets
● Always in your toolkitAbout the project ↗

Azure subscription and resource inventory cheat sheet

Check CLI context and inventory resources in the intended subscription.

Azure CLI 2.x with Azure Resource Manager read permissions.

Updated · Azure · 7 min read

CommandWhat it does
az loginAuthenticate interactively
az account show --output tableInspect active subscription
az account list --output tableList available subscriptions
az resource list --output tableInventory current-subscription resources

Walkthrough

Install Azure CLI through your approved process. Sign in to your authorized tenant. Reader access is sufficient for most inventory queries.

Step 1: Authenticate interactively

az login

Choose the intended tenant and account during sign-in. Authentication does not guarantee access to every subscription.

Step 2: Inspect active subscription

az account show --output table

Confirm tenant ID, subscription ID and account. Stop before resource queries if the active subscription is not the intended one.

Step 3: List available subscriptions

az account list --output table

Use the subscription identifiers to distinguish similarly named environments. To switch intentionally, use az account set --subscription <subscription-id>; this changes local CLI context.

Step 4: Inventory current-subscription resources

az resource list --output table

Inspect resource type, name and resource group. An empty inventory may mean the wrong context or limited RBAC visibility rather than no deployed resources.

Azure official documentation