Azure Backup Email Notification Failure


I’ve recently setup Azure Backup for a customer and they wanted to be notified when/if a failure happened on a VM and it was unable to Backup

Currently this can only be done via PowerShell and not in the Portal

# Script Created by Craig Cloud IT Pro v.01 #


# This script will create an Email Alert to send an email when a backup job has failed #


# Import Azure Module #

Import-Module AzureRm

# Login to your Azure Account or Select your Profile #

# Login-AzureRmAccount

Select-AzureRmProfile -Path "C:\Scripts\#azureprofile.json"

# Input the User or Distribution List you wish to send too #

$actionEmail = New-AzureRmAlertRuleEmail -CustomEmail ""

# Create the Alert Rule #

Add-AzureRmLogAlertRule -Name "Backup Failed" -Location "West Europe" -ResourceGroup "CF-ASR-Home" -OperationName "Microsoft.RecoveryServices/recoveryServicesVault/Backup" -Status "Failed" -TargetResourceId "/subscriptions/yoursubscriptionID/resourceGroups/CF-ASR-Home/providers/Microsoft.RecoveryServices/vaults/CF-ASR-RSV" -Actions $actionEmail

# Delete the Alert Rule if you no longer need it #

Remove-AzureRmAlertRule -ResourceGroup "CF-ASR-Home" -Name "backupFailedAlert"



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s