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
| Command | What it does |
|---|---|
az login | Authenticate interactively |
az account show --output table | Inspect active subscription |
az account list --output table | List available subscriptions |
az resource list --output table | Inventory 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.