Use Azure Alert Rules to monitor changes in Automatic Instance Repairs ServiceState
This article shows you how to use Alert Rules from Azure Monitor to receive custom notifications every time the ServiceState for Automatic Repairs is updated on your scale set. This will help track if Automatic Repairs become Suspended due to VM instances remaining unhealthy after multiple repair operations. To learn more about Azure Monitor alerts, see the alerts overview.
To follow this tutorial, ensure that you have a Virtual Machine scale set with Automatic Repairs enabled.
Azure portal
- In the portal, navigate to your VM scale set resource
- Select Alerts from the left pane, and then select + Create > Alert rule.
- Under the Condition tab, select See all signals and choose the signal name called “Sets the state of an orchestration service in a Virtual Machine Scale set”. Select Apply.
- Set Event Level to “Informational” and Status to “Succeeded”.
- Under the Actions tab, select an existing action group or see Create action group
- Under the Details tab > Alert rule name, set a name for your alert. Then select Review + create > Create to create your alert.
Once the alert is created and enabled on your scale set, you'll receive a notification every time a change to the ServiceState is detected on your scale set.
Sample email notification from alert rule
Below is an example of an email notification created from a configured alert rule.
Creating an action group
- Under the Actions tab, select Create action group.
- In the Basics tab, provide an Action group name and Display name.
- Under the Notifications tab > Notification type, select “Email/SMS message/Push/Voice”. Select the edit button to configure how you’d like to be notified.
- Select Review + Create > Create