By running the script with administrative rights, it should be able to install all the prerequisites and runs smoothly, but if you prefers we can run the following commands just to make sure everything is set to run the script:
- Install Azure CLI:
Download and install Azure CLI (https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
- Make sure the execution of scripts is allowed:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
- Install Azure CLI Extensions:
az extension add --name resource-graph
- Install Import-Excel Powershell Module:
Install-Module -Name ImportExcel
- Download the Azure Resource Inventory Files:
- Extract the Files:
- Unblock the main file:
There are several parameters that can be used in the script, but just running the script without any parameter is enough to generate a standard Excel spreadsheet.
If you have permissions on more than one tenant, the script will prompt which Tenants do you want to run the inventory against:
If can also select which Tenant do you want to run the inventory against:
Draw.io .XML file will be put in the "C:\AzureResourceInventory" folder:
Now you just need to open draw.io and open the file: