Azure resource management

How to export a resource inventory in Azure

Export every Azure resource with Azure PowerShell and Resource Graph, export All resources to CSV in the Azure portal, or run Altivane's Azure Resources report for a workbook to keep.

By the Published

To export a resource inventory in Azure, query the Resources table in Azure Resource Graph across your subscriptions and save each resource's name, type, location, SKU and tags. Resource Graph indexes changes with a short delay, so a resource created a moment ago can be missing, and it lists only what your account can read.

Choose the method that fits the job
MethodBest fit
PowerShellA CSV of every resource across your enabled subscriptions, with subscription names.
Admin centreA quick CSV of the resources a filtered view shows.
AltivaneRecommended for monthly inventories, with counts by type and location beside the list.

Before you start

Use an account with read access to the subscriptions, such as the Reader role: Resource Graph returns nothing for resources you can't read. Resource Graph is free to query, and Microsoft lists no licence for it.

Know what the table holds. The Resources table has most Resource Manager resource types; resource groups and subscriptions are in ResourceContainers instead. Resource Graph reads each type through its latest non-preview API, so a property you expect can be missing. The examples read and export; they change nothing. The script's finally block disconnects the account and clears its saved Azure contexts.

Option 1

Export a resource inventory with PowerShell

Install the modules once. The script queries Resource Graph across the enabled subscriptions, follows every page of results, and saves 1 row for each resource with its subscription's name.

PowerShell
Install-Module -Name Az.Accounts, Az.ResourceGraph -Repository PSGallery -Scope CurrentUser
PowerShell
$ErrorActionPreference = 'Stop'
Connect-AzAccount -ErrorAction Stop
try {
    $subscriptions = @(Get-AzSubscription | Where-Object State -eq 'Enabled')
    if ($subscriptions.Count -eq 0) {
        Write-Output 'No enabled subscriptions are available to this account.'
        return
    }
    $names = @{}
    foreach ($subscription in $subscriptions) { $names[$subscription.Id] = $subscription.Name }
    $query = @(
        'Resources'
        '| project id, name, type, kind, resourceGroup, subscriptionId, location,'
        'sku = tostring(sku.name), tags = tostring(tags)'
        '| order by id asc'
    ) -join ' '
    $rows = [System.Collections.Generic.List[object]]::new()
    $skipToken = $null
    do {
        $arguments = @{ Query = $query; Subscription = @($subscriptions.Id); First = 1000 }
        if ($skipToken) { $arguments.SkipToken = $skipToken }
        $page = Search-AzGraph @arguments
        foreach ($record in $page.Data) { $rows.Add($record) }
        $skipToken = $page.SkipToken
    } while ($skipToken)
    if ($rows.Count -eq 0) {
        Write-Output 'No resources were found in the enabled subscriptions.'
    } else {
        $rows | Sort-Object subscriptionId, resourceGroup, name | ForEach-Object {
            [pscustomobject]@{
                Name          = $_.name
                Type          = $_.type
                Kind          = $_.kind
                ResourceGroup = $_.resourceGroup
                Subscription  = $names[$_.subscriptionId]
                Location      = $_.location
                Sku           = $_.sku
                Tags          = $_.tags
                ResourceId    = $_.id
            }
        } | Export-Csv -Path './azure-resources.csv' -NoTypeInformation -Encoding utf8
        Write-Output "$($rows.Count) resources saved to azure-resources.csv."
    }
} finally {
    Disconnect-AzAccount | Out-Null
}

The CSV holds each resource's name, Azure's type name, kind, resource group, subscription, location, SKU and tags, with tags written as JSON. To keep 1 kind of resource, add '| where type =~ "microsoft.storage/storageaccounts"' before the project line. Resource Graph paging needs id in the results, so keep it if you edit the query.

Option 2

Export All resources in the Azure portal

  1. Sign in to the Azure portal with an account that can read the subscriptions.
  2. Search for All resources and open it.
  3. Filter the list to the subscriptions and resource groups you need. To add columns such as tags, select Manage view > Edit columns, add them and select Save.
  4. Select Export to CSV and open the file in Excel.

The export follows the filters and columns on screen, so check them first. Open query opens the same view as a query in Resource Graph Explorer. This suits a quick list for 1 review; for the same file every month, use PowerShell or Altivane.

Common questions

Why are my resource groups missing from the export?

Resource Graph keeps resource groups and subscriptions in the ResourceContainers table, not in Resources, so query that table for them. In Altivane, the Azure Resource Groups report lists them.

Why does Resource Graph Explorer stop at 55,000 rows?

Its Download as CSV is limited to 55,000 records, a platform limit that a support request can't raise. For a larger inventory, use PowerShell, which reads the results 1,000 at a time.

How do I find the resources with no tags?

The Tags column is empty for them, but a query that keeps only those is quicker. See how to find resources without tags in Azure.

Microsoft references

Technical references checked on 7 November 2026. The example scripts have been reviewed and syntax checked; they have not been run against a live tenant.

Talk to us about Altivane

Questions, or pricing? Get in touch.

Contact us