Skip to content

Latest commit

 

History

History
179 lines (104 loc) · 2.82 KB

README.md

File metadata and controls

179 lines (104 loc) · 2.82 KB

Azure Resource Inventory Automation Account v3.5



This section explain how to create an Automation Account to run Azure Resource Inventory automatically.



What is required to run ARI as an Automation Account?



1) Azure Automation Account

2) Azure Storage Account

3) Azure Blob Container inside the Storage Account



These are the steps you have to do after creating the Automation Account:



On the Automation Account, enable the System Assigned Identity:



This will create an identity in the Entra ID.

Now we are going to use that identity to give the following permissions to the Automation Account:

1) Reader in the Management Group (for the script to be able to read all resources from Azure):



2) Storage Blob Data Contributor to the Storage Account



Now, back to the Automation Account, switch to the new Runtime Environment Experience:



Now, create a new Runtime Environment Experience:



The version must be 5.1:



In the "Packages" pane, import the following Modules from Gallery:



1) "AzureResourceInventory"

2) "ImportExcel"

3) "Az.ResourceGraph"

4) "Az.Accounts"

5) "Az.Compute"

5) "PowershellGet"

7) "ThreadJob"


After the Runtime finish adding all the modules, create a Powershell Runbook:



Now just add the "Invoke-ARI" command line inside the runbook:



NOTE: Make sure to select the Runtime Environment you created.

The line must contain the following parameters:

-TenantID
-SkipDiagram
-SkipAPIs
-Automation
-StorageAccount
-StorageContainer

i.e:

Invoke-ARI -TenantID "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" -Automation -SkipDiagram -SkipAPIs -StorageAccount "stgaccari001" -StorageContainer "reports" -Debug


The parameter "StorageAccount" is used to inform the Storage Account where the report will be placed and the "StorageContainer" parameter is used to inform the container within that Storage Account where the report will be placed.



Hit Save and Publish and you are ready to go.