Excel spreedcheet with the full Azure environment
Windows / Linux / Mac
Powershell, Azure, Inventory, Excel Report, Customer Engineer
Azure Resource Inventory v2.1
Azure Resource inventory (ARI) is a powerful script writen in powershell to generate an Excel report of any Azure Environment you have read access.
This project is intend to help Cloud Admins and anyone that might need an easy and fast way to build a full Excel Report of an Azure Environment.
What's new ?
The first big change in Azure Resource Inventory v2 is the modularization. This means all the files in the repository must be download for the script to work properly.
In ARI V1 we have only one Script. Authentication, Extraction, Data handling and Spreadsheet creation were made in Main Script only ( AzureResourceInventory.ps1 ).
In ARI V2 the code is much more efficient. The Main Script is responsable only for Authentication and Extraction. Data management and spreadsheet creation are being performed through external modules that are scanned and executed by the Main script.
1) New Dashboard Overview
- New Dashboard with much more information and resource list linking to the sheet.
2) Azure Diagram Inventory!
- The BIG Improvement for this version is Azure Diagram Inventory, two Extra Modules that creates a Microsoft Visio1 and a Draw.io Diagram2 of the Azure Network Environment. Since Draw.io and Microsoft Visio Diagram are additional modules. You must use the -Diagram parameter for it to be generated!
Microsoft Visio Diagram:
For the Microsoft Visio Diagram, is necessary to have Microsoft Visio installed with subscription Visio Plan 2.
For the Draw.io Diagram, the script will create a XML file inside the "C:\AzureResourceInventory" folder. On Draw.io you must go to File > Import from > Device... And import the XML file that was created by the script.
3) Many new resource types
For ARI V2 we added many more native modules ( and the possibility to create your own module ;)
Resources and Resource Providers:
|Resource Provider||Resource Type|
|microsoft.compute||Virtual Machine Scale Set|
|microsoft.network||Virtual Network Peerings|
|microsoft.network||Virtual Network Gateway|
|microsoft.network||Public IP Address|
|microsoft.network||Public DNS Zones|
|microsoft.network||Private DNS Zones|
|microsoft.dbformysql||Azure Database for MySQL|
|microsoft.dbforpostgresql||Azure Database for Postgre|
|microsoft.cache||Azure Cache for Redis|
|microsoft.web||App Service Plan|
|microsoft.automation||Automation Accounts and runbooks|
|microsoft.operationalinsights||Log Analytics Workspaces|
|microsoft.containerservice||Azure Kubernetes Service|
|microsoft.redhatopenshift||Azure RedHat OpenShift|
|microsoft.desktopvirtualization||Azure Virtual Desktop|
|microsoft.recoveryservices||Recovery Services Vault|
|microsoft.streamanalytics||Streaming Analytics Jobs|
4) Other improvements
These instructions will get you a copy of the project up and running on your local machine or CloudShell.
|Resource Provider||Results||VISIO Extension||Comments|
|Windows||Fully successfully tested||Supported||Best Results|
|MAC||Fully successfully tested||Not Tested|
|Linux||Tested on Ubuntu Desktop||Not Supported||No Table auto-fit for columns|
|CloudShell||Tested on Azure CloudShell||Not Supported||No Table auto-fit for columns|
Our Test Environment:
|Microsoft Visio||Visio Plan 2|
You can use Azure Resource Inventory in both in Cloudshell and Powershell Desktop.
What things you need to run the script
1. Install-Module ImportExcel 2. az cli 3. az extension add --name resource-graph
To install Azure CLI go to Microsoft Docs and follow the instructions to install.
By default Azure Resource Inventory will call to install both ImportExcel module and resource-graph extension but you need to have the right privileges during the script execution.
Special Thanks for Doug Finke, the Author of Powershell ImportExcel Module.
Very Important: If you alread have Resource-Graph and ImplortExcel Azure Resource Inventory will not upgrade it even if your version isn't supported.
If you're facing the bellow errors during your execution and your inventory aren't being generated check for updates in your Resource Graph extension in Az Cli.
1. az extension list-available --output table ## Check if resource-graph extension upgrade is available 2. az extension update --name resource-graph
Important: If you're running the script inside Azure CloudShell the final Excel will not have Auto-fit columns and you will see warnings during the script execution (but the results of your inventory will not be changed :)
Running the script
Its really simple to use Azure Resource Inventory, all that you need to do is to call this script in PowerShell.
Run "AzureResourceInventory.ps1". In Azure CloudShell you're already authenticated. In PowerShell Desktop you will be redirected to Azure sign-in page.
- If you have privileges in multiple tenants you can specify the desired one by using "-TenantID" parameter or Azure Resource will scan all your tenants ID and ask you to choose one.
After properly authenticated and with the TENANT selected, the Azure Resource Inventory will perform all the work of extracting and creating the inventory.
The duration will vary according to the number of subscriptions and resources. In our tests we managed to generate in 5 minutes the inventory of a Tenant with 15 subscriptions and about 12000 resources.
Azure ResourceInventory uses "C:\AzureResourceInventory" as default folder for PowerShell Desktop in Windows and "$HOME/AzureResourceInventory" for Azure CloudShell to save the final Excel file.
This file will have the name "AzureResourceInventory_Report_yyyy-MM-dd_HH_mm.xlsx" where "yyyy-MM-dd_HH_mm" are the date and time that this inventory was created.
Versioning and changelog
We also keep the
CHANGELOG.md file in repository to Document version changes and updates.
The main authors of this project are:
Please read our CONTRIBUTING.md which outlines all of our policies, procedures, and requirements for contributing to this project.
For the Microsoft Visio Diagram, is necessary to have Microsoft Visio installed with subscription "Visio Plan 2"
For the Draw.io Diagram, the script will create a XML file inside the "C:\AzureResourceInventory" folder. On Draw.io you must go to File > Import from > Device... And import the XML file that was created by the ARI script.