Use PRTG to monitor Azure Backup status (updated 07-2022)
Recently I received the question if it is possible to monitor Azure Backup with PRTG. Now this might seem to be a bit weird, as we could use Azure monitoring. But in this case, it was a service provider that needed a single solution for all their services, including custom dashboards and monitoring.
So, challenge accepted, lets get this done! In this case the customer has a Azure Recovery Service Vault with 2 virtual machines, with a backup schedule of only once every 24 hours with a retention of 30 days.

Our goal will be to have 3 sensors in PRTG with the completed jobs, failed jobs and running jobs. If you follow the next steps you should be able to set this up your self as well.
Step 1: Create and application registration in the Azure Portal, so go to Azure Active Directory, and fill in all the required fields. Note, the Redirect URL may be completely random, but it is nice to set it to your PRTG monitoring URL. In this example its just a random address.

Step 2: Go to your created application, and go to overview. Copy the Application ID and Tenant ID to a notepad or something, we will need them later.

Step 3: Go to certificates & secrets, and create a new client secret. Make sure that you save the secret, you will not be able to read it again! You can only create a new key.

Step 4: Now go to the service recovery vault where you want to read the backups from, and assign the PRTG application the Backup Reader role. Also make sure that the account has read permissions on the subscription level!

Step 5: On your PRTG (Probe) server install the AzureRM Module using the following command:
install-module az
Step 6: On your PRTG (Probe) server, we will need to create a little powershell script, and save it on the following location: C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\AzureBackupStatus.ps1
Step 7: The final step, go into your PRTG environment, and create a new sensor on the device where you’ve added the powershell script. Search for the EXE sensor, and create the EXE/Script Advanced Sensor.

Next step is to configure the sensor properly with the following settings:
- Sensor Name: Set it to whatever you like ๐
- EXE/Script: AzureBackupStatus.ps1
- Parameters: -password ‘<secretvalue>’ -applicationid ‘<applicationid>’ -TenantId ‘<tenantid>’
Make sure that the entries from the previous steps are added between the ”. When finished click create.

The last step is to change the interval in PRTG. Change it to something smart for your environment. I would recommend max once every hour. The result will look like this:

What if it doesn’t work?
I’ve received a lot of questions and comments that it doesn’t work. The reason that it might not work is because of wrong parameters. To test it and see which part is wrong, log in to your PRTG Probe machine using PRTG, and adjust the script a little bit, and run it with the logged on user.
$password = “<secretvalue>”
$applicationid = “<applicationid>”
$TenantId = “<tenantid>”
The result should look like this:

If there is something wrong, you will get an error like this, in this error, the wrong client secret has been used.

I hope this helps.
Hi! My script only returns this message and PRTG donesn’t recognize the output:
1
Backup failed, failed jobs: 0
Hi Rogerio,
You are right! I noticed that I forgot to update the script. Please try again now, it should work now.
Thank you.
Cor
Hi Cor! Sorry for the late answer.
Happy new year!!
Now in the Sensor Log is the message:
At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\AzureBackupStatus.ps1:25 char:7
+ $i++ $rcvaults=Get-AzureRmRecoveryServicesVault foreach ($rcvault in …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token ‘$rcvaults=Get-AzureRmRecoveryServicesVault’… and some other errors.
And the PRTG message is: “XML: The returned XML does not match the expected schema. (code: PE233) — JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)”
As emailed, I’ve changed the view of the code, this should help get it copied correctly.
Hello,
Is this the right syntax;
-password โ -applicationid โ -TenantId โ
with one ” at the end including a whitespace and the minus?
I do not get the right output;
Backup failed, failed jobs: 0
These are single quotes. I will create a download link for the script later on, I notice more people have problems with getting the script to run.
For some reason my App is not showing up in the Recovery Services Vault , Access Control.
Hi,
Is there any chance you can provide another code link or confirm that this is still functional? I am getting the same errors as others with the following output:
1
Backup failed, failed jobs: 0
Hi GM,
I will review the script this week, will let you know.
Cor
HI!
Did you review the script yet? I get the same error as the user “GM”.
Backup failed, failed jobs: 0
Do you have any idea what Iยดm doing wrong here?
Thank you so much!
Hi Mario,
yes I did, i’ve created a download button, and a little troubleshooting guide at the end of the post. Hope this helps.
Cor
Hi Cor,
Thanks for publishing this guide. I am having a similar issue to others in that i get “Backup failed, failed jobs: 0” (the “else{” condition at the end of the script). I’ve double checked my ID’s and i can’t see any obvious issues. Any ideas what might be wrong? I can provide more details if need be,
Thanks to Alex and Mario, I found out that backup reader permissions isn’t enough anymore. Make sure that you grant the application read permissions on the subscription level. This should get the script working again.
hello cor,
Thank you very much for your contribution to expanding monitoring of the Azure environment with PRTG.
In my Azure subscription, I have some Recovery Services backup vaults spread across a few regions, with different Resource Group and different backup methods (Azure Virtual Machine,Azure Backup Agent,Azure Storage (Azure Files)). In my case, it is only taking the result of 1 Recovery Services vaults from the Azure Virtual Machine resource of a region and not counting the other Recovery Services vaults.
Hi Everton, I have never tried that before. Did you grant permissions to all recovery vaults? Are they all in the same subscription?
Please let me know, I will test your setup later, but might take a few weeks.
Cor
hello cor,
Many thanks for the reply. Yes, all Recovery Services vaults are on the same Azure subscription, the only difference is the region and resource group they are allocated. Permission has been assigned at subscription level โReadโ for all objects in the subscription. To ensure the permission is correct, I have checked all Recovery Services vaults, and the โReadโ permission is being inherited correctly
hello color,
Many thanks for the reply. Yes, all Recovery Services vaults are on the same Azure subscription, the only difference is the region and resource group they are allocated. Permission has been assigned at subscription level “Read” for all objects in the subscription. To ensure the permission is correct, I have checked all Recovery Services vaults, and the “Read” permission is being inherited correctly.
Hi Cor,
I create a modified script based on your script. Sharing is caring so here you are ๐
The reason I write a blog post is that this comment section I had to few characters to share the full script.
https://blog.wapnet.nl/2025/01/prtg-monitor-azure-backups/