It’s good to be proactive and one way is to setup alerts and it is no different when using Azure SQL Database. I like creating alerts for my Azure SQL Databases and I encourage you to do the same.
I keep things simple and like to look at certain performance based metrics but before talking about what metrics are available let’s step through an example.
For this post I want to setup an alert for CPU percentage utilised that when it is greater than 50% over the last 5 minutes I would like to know about it. First step is to navigate to your Azure SQL Database.
Click on your database and under the monitoring node you should find Alert Rules where you should then click Add alert.
This is what the main screen will look like.
The different metrics available to you are:
As mentioned before I want to be alerted on CPU so I apply the following.
I then cause CPU spikes over a 5-minute window. This is easy for me to do because I am bad at T-SQL.
I get a pleasant email from Microsoft – simple yet effective.