Skip to content

Backup Monitoring Azure VM Alert Rule

amitjainau edited this page Oct 22, 2021 · 1 revision

This is a piece of work that I did nearly 5 years for a setting up backup monitroing and alert using powershell.

  1. Start powershell by searching for 'ise'.

  2. Login to Azure

PS C:\WINDOWS\system32> Login-AzureRmAccount

  1. Set you subscription

Get-AzureRmSubscription -SubscriptionName "123 - Amit Test" | Set-AzureRmContext

  1. Add backup failed alert rule

PS C:> Add-AlertRule -Operator GreaterThanOrEqual -Threshold 1 -ResourceId '/subscriptions/123456-123c-123-123-123456751d/resourceGroups/RecoveryServices-1234567890-Australia-East/providers/microsoft.backup/BackupVault/Amit-Backups' -EventName Backup -EventSource Administrative -Level Informational -OperationName 'Microsoft.Backup/backupVault/Backup' -ResourceProvider Microsoft.Backup -Status Failed -SubStatus Failed -RuleType Event -Location "Australia East" -ResourceGroup RecoveryServices-123456789075A-Australia-East -Name Backup-Failed -Description 'Backup Failed for one of the VMs in vault Amit-Backups' -CustomEmails 'test.support@xyz.com.au'

===== OUTPUT =============

WARNING: This cmdlet is being modified to enable better experience and may contain breaking changes in a future release.

RequestId StatusCode


0abc-eabc-4abc-9abc-abcbae Created

Clone this wiki locally