Create an Azure automation runbook
Here we will create a runbook in the automation account that will retrieve data from Microsoft Graph using the REST API and export the data to the Azure storage account.
Last updated
Was this helpful?
Here we will create a runbook in the automation account that will retrieve data from Microsoft Graph using the REST API and export the data to the Azure storage account.
Last updated
Was this helpful?
It is highly recommend to use the latest PowerShell Core runtime version to execute the runbook (7.2 at the time of writing)
Download the runbook from my GitHub repo.
In the runbook script, set the first four variables in the Variables script region at the top.
$ReportType. Specify "Overview" to just export the data required by the Overview report, "Detailed" to just export the data required by the Detailed report, or "All" to export both.
$ResourceGroup. Enter the name of the Azure resource group containing your Azure storage account.
$StorageAccount. Enter the name of the Azure storage account.
$Container. Enter the name of the Container in your storage account where you'll be exporting the data.
Click on the Runbooks pane and choose Create a runbook
Choose Browse for file and locate the runbook script file
Select a Runtime Environment
Enter a Description if desired, and click Review + Create, then Create
In the Edit PowerShell Runbook window, Publish the runbook
Schedule the Runbook to execute at regular intervals to keep the data updated.
In the Azure portal, in the automation account, open the Runbook you created
Click Link to schedule
In the Schedule section, select an existing schedule or create a new one