Create event notifications based on metrics
In this tutorial we will learn how to create event notifications based on metrics with setting up Azure Database for MySQL alerts using the Azure portal. You can receive an alert based on monitoring metrics for your Azure services. The alert triggers when the value of a specified metric crosses a threshold you assign. Further, the alert triggers both when the condition is first met, and then afterwards when that condition is no longer being met.
However, you can configure an alert to do the following actions when it triggers:
- Firstly, send email notifications to the service administrator and co-administrators
- Secondly, send email to additional emails that you specify.
- Lastly, call a webhook
Create an alert rule on a metric from the Azure portal
- Firstly, in the Azure portal, select the Azure Database for MySQL server you want to monitor.
- Secondly, under the Monitoring section of the sidebar, select Alerts.
- Thirdly, select Add metric alert (+ icon).
- Then, the Create rule page opens. Fill in the required information.
- Within the Condition section, select Add condition.
- After that, select a metric from the list of signals to be alerted on. In this example, select “Storage percent”.
- Next, configure the alert logic including the Condition (ex. “Greater than”), Threshold (ex. 85 percent), Time Aggregation, Period of time the metric rule must be satisfied before the alert triggers (ex. “Over the last 30 minutes”), and Frequency.
- And, select Done when complete.
- Within the Action Groups section, select Create New to create a new group to receive notifications on the alert.
- Then, fill out the “Add action group” form with a name, short name, subscription, and resource group.
- After that, configure an Email/SMS/Push/Voice action type.
- Here, choose “Email Azure Resource Manager Role” to select subscription Owners, Contributors, and Readers to receive notifications.
- Optionally, provide a valid URI in the Webhook field if you want it called when the alert fires.
- Here, choose “Email Azure Resource Manager Role” to select subscription Owners, Contributors, and Readers to receive notifications.
- Select OK when completed.
- After that, specify an Alert rule name, Description, and Severity.
- Lastly, select Create alert rule to create the alert.
- Within a few minutes, the alert is active and then, triggers.
Manage your alerts
Once you have created an alert, you can select it and do the following actions:
- Firstly, view a graph showing the metric threshold and the actual values from the previous day relevant to this alert.
- Secondly, Edit or Delete the alert rule.
- Lastly, Disable or Enable the alert, if you want to temporarily stop or resume receiving notifications.
Reference: Microsoft Documentation
Prepare for Assured Success
Want to pass Administering Relational Databases on Microsoft Azure (DP-300) Exam? Learn MoreAre you preparing for Administering Relational Databases on Microsoft Azure (DP-300) Exam?Take a Quiz