It’s all well and good having set yourself up a S2S VPN to link your Azure and On-Prem resources, but how do we monitor and alert for any outages on our VPN connection.
Surely there has to be a better way than logging into the Azure portal every time and checking the status?
Luckily we can easily setup an alert in Azure to notify us of any issues with our VPN connection.
Creating our alert
Log into our Azure Portal and navigate to our Virtual Network Gateway and find the Monitoring section on the left menu. Choose the option for Alerts
From the top menu choose Create and then Alert rule
From the Select a Signal screen choose Gateway S2S Bandwidth
Scroll down to the Alert Logic and set the Operator to Less than or equal to, the Aggregation type to Normal and the Threshold value to 0. Tweak your Aggregation granularity and Frequency of evaluation as you see fit depending on how quickly you need to be alerted
Once you see your Condition as below you can choose Next: Actions
Under the Actions screen, you’ll need to choose Create Alert Group so that our Alert actually does something
Choose your Subscription and Resource Group and give your Alert Group a name, select Next to choose your Notification Type
Change Notification type to Email Azure Resource Manager Role
Change Azure Resource Manager Role to whichever role you see fit, and select Yes for Enable the common alert schema then click OK
Give a name to your Notification type and select Next: Actions
We can set Action types that will run when our alert is triggered from the below options but in our case we’re going to skip this step, lets continue on to the review screen
Lets hit the button to test our new alert and choose Metric alert – Static threshold and click Test
You should receive an email similar to the below
Now that we know that our alert works we can return to our Azure Portal and click Create to finalise the creation of our alert
Click Next: Details to take us to our details page for our alert. Choose your Severity level as appropriate and give your alert a name, leave the box ticked to Enable upon creation and decide whether you want alerts to be automatically resolved
Continue to the review screen and click Create.
We now have an alert setup that will email us when our S2S VPN drops it’s connection.
How does our alert look when it is triggered for real?
Your alerts come from the Microsoft email email@example.com
When an alert is triggered you’ll receive an initial email with a ton of information about the resource and metrics that triggered the alert that looks like the below
At the point when your resource is working again and the alert is resolved you’ll receive an email from the same address that looks like this
Now that you know how to configure and enable your alerts you can setup alerts for your other Azure resources!