Inventory Azure resource groups
Documentation: Microsoft Learn
Get-AzResourceGroup returns every group in the subscription the context points at, and the projection keeps the group name with its location and provisioning state.
The script
Script reader
Inspect before you run
Inspect the script below. It does not run in this browser.
Inspection only — no command has run.
Show reference output
Inspect this example’s structure
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-AzResourceGroup | Select-Object ResourceGroupName,Location,ProvisioningState- Stage 1Get-AzResourceGroup
Positional values or no named parameters - Stage 2Select-Object
Positional values or no named parameters
How it works
Get-AzResourceGroup returns every group in the subscription the context points at, and the projection keeps the group name with its location and provisioning state.
Adapting it
Add a calculated property that joins the Tags hashtable into a string so cost center and owner tags appear in the same table, which is normally the reason anyone asked for the list.
Requirements
Az.Resources with a Connect-AzAccount session.
If the result is unexpected
The resource-group list is unexpectedly short.
The current subscription or access scope may exclude the groups the operator expects.
- Confirm the subscription and compare one known resource-group name and location.
Validate the result
The report matches the intended subscription and includes its identifier.
Keep the check reliable
Require explicit subscription selection before inventory collection.