Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get all the resources in a subscription to CSV
#connect to the teanant
Connect-AzAccount -t 'tenant_id_guid'
#get the guids of the subscriptions
Get-AzSubscription
#use one of the guids from the previous command
Select-AzSubscription -SubscriptionId 'subscriptio_id_guid' -TenantId 'tenant_id_guid'
#export the everything as CSV
Get-AzResource | Export-Csv -Path ~/Desktop/azure-inventory.csv
#export selected columns as CSV
Get-AzResource | Select-Object Name, ResourceGroupName | Export-Csv -Path ~/Desktop/azure-inventory-1.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.