This post is about creating an Intune backup to a storage account Pt.3. You could use this to create a daily backup or even more frequent.
The clarify the above. I created a script that creates a backup from your Intune environment and uploads it to a storage account.
The last step is to send a notification about the changes that have been made between the latest 2 backups. We do so by sending mail via the Graph API.
Other parts:
Intune Backup to Storage Account Pt.1 – The Script
Intune Backup to Storage Account Pt.2 – The Automation Account
Prerequisites
Complete the other parts of this series:
Intune Backup to Storage Account Pt.1 – The Script
Intune Backup to Storage Account Pt.2 – The Automation Account
After that, you are ready to start this blog!
Add permissions to Service Principal
The Service Principal needs extra API permissions to be able to send an e-mail via Graph.
Firstly, log on to Microsoft Azure.
After that, go to your Service Principal you created in the first part of this series. Add the following permissions:
Add these permissions:
Lastly, consent the permissions:
Add a new runbook for the notification
The notification that is sent via mail is sent via Graph. I have put this in a Powershell script which downloads the blobs from the Azure Storage Account, then compares the files, notes the changes and after that sends the changes via mail.
So, go to your Automation Account which you created in the second part of this series.
After that, create a new runbook:
Set the variables:
I have published the script on my Github account. You can find it here.
After that, change these parameters accordingly:
Running the RunBook
Lastly, we run the runbook to create the e-mail notification. Click on run:
After that, the blobs are downloaded from the storage account:
The comparison is done:
And that is then send via mail:
2 thoughts on “Intune Backup to Storage Account Pt.3 – The Notification”