Thursday, April 19, 2018

Enable Azure hosted SQL service notifications.


Enable Azure hosted SQL service notifications.

This article shows the step to set up Azure SQL Database and Data Warehouse alerts using the Azure portal. This article also provides best practices for setting alert periods.

To do this you can use OMS or the Azure portal. Here we are using the Azure portal to configure notifications.

You can receive an alert based on monitoring metrics for, or events on, your Azure services. This will be based on the section that you are going to

Activity log events - An alert can trigger on every event, or, only when a certain number of events occur.

Metric values - The alert triggers when the value of a specified metric crosses a threshold you assign in either direction. That is, it triggers both when the condition is first met and then afterwards when that condition is no longer being met.

You can configure an alert to do the following when it triggers:

· Send email notifications to the service administrator and co-administrators

· Send email to additional emails that you specify.

· Call a webhook

Once you go into the SQL instance in the Azure tenant you will see the below mentioned window where you can see the overall performance and the database utilization.

clip_image002

1. To configure the notification you can select the SQL instance then Alerts under monitoring.

2. Then click ad alert.

clip_image004

3. Select the Add alert command and fill in the fields.

clip_image006

4. Name your alert rule, and choose a Description, which also shows in notification emails.

5. Select the Metric you want to monitor, then choose a Condition and Threshold value for the metric. Also choose the Period of time that the metric rule must be satisfied before the alert triggers.

So for example, if you use the period "5 min" and your alert looks for CPU above 80%, the alert triggers when the average CPU has been above 80% for 5 minutes. Once the first trigger occurs, it again triggers when the average CPU is below 80% over 5 minutes. The CPU measurement occurs every 1 minute. Consult the table below for supported time windows and the aggregation type that each alert uses- not all alerts use the average value.

Supported metrics list is mentioned below, Highlighted metrics used in our environment which helps to do the changes before effecting to the live DB failures.

clip_image008

6. Check Email owners... if you want administrators and co-administrators to be emailed when the alert fires.

7. If you want additional emails to receive a notification when the alert fires, add them in the Additional Administrator email(s) field. Separate multiple emails with semi-colons - email@XYZ.com;email2@XYZ.com

8. Put in a valid URI in the Webhook field if you want it called when the alert fires.

9. Select OK when done to create the alert.

It will take few min to activate the alert.


Once the alert rule is created then you can select that and mange that.

  • · Edit or delete it.
  • · Disable or Enable it if you want to temporarily stop or resume receiving notifications for that alert
  • · View a graph showing the metric threshold and the actual values from the previous day.

Can be done by selecting the cleated alert rule.

No comments: