The script exports your Azure inventory as CSV files. It builds different CSV files for each subscription with resources.
This is most useful if you change your contract model. For example from EA or Pay-As-You-Go to a CSP contract. Some of the marketplace resources aren't available yet in CSP. You can send your CSP provider this files to give them an overview about your Azure environment.
- PowerShell >= 5.1 or PowerShell Core 6.x
- Azure PowerShell Az Module
You can download this module at: https://github.com/Azure/azure-powershell/releases/latest
or install it directly withInstall-Module -Name Az
- At least "Reader" rights on your desired subscriptions
- Download or clone this repo
- Open up a PowerShell (non-elevated is fine)
- (optional) Connect to your Azure environment by running
Connect-AzAccount
- Run
.\Get-AzureInventory.ps1
. If you're not connected now, it will connect you now. - As a result you'll get different CSV files:
- "subscriptions.csv" with information about all scanned subscriptions.
- "inventory_<subscription_id>.csv" with all resource information (Name, Resource Group, Type, SKU)
- "marketplace_<subscription_id>.csv" with all marketplace resources
Parameter | Default | Possible Value |
---|---|---|
-SubscriptionId |
empty | A subscription ID from your environment. The script will only load resources from this subscription. |
-Verbose |
Set this parameter to get more information while the script is running |