Setting up email alerts for your vscode extension using Azure

Almenon
2 min readAug 4, 2018

--

One of the things I loved about making my reddit_episode_bot was that I get emails whenever it comments. Each email i get is a little payoff for all the hours of work I put into that darn thing. But it’s not just for my satisfaction; each email is a sign that the bot is still working.

For my reddit bot I used IFTTT; it was amazingly simple. Setting up the same thing for my VSCode extension wasn’t quite as easy, but it can still be done in 10 steps.

Pre-req: follow my guide on setting up extension telemetry

  1. go to monitor

2. Select “Alerts” from Shared Services on the left

3. Click on “Add new alert rule” on the top

4. Select a target and choose your subscription and Application Insights as the resource type

image from https://azure.microsoft.com/en-us/blog/log-alerts-for-application-insights-preview/

5. add criteria, and choose custom log search

6. Fill out the search query, alert logic, and evaluation

In your case the search query will be different

7. Define your alerts details (just a name, description, and severity, nothing complicated here)

8. In Define action group create a new action group.

  • You can choose “webhook” to push a payload to a url. This can be used to trigger a IFTTT action, or send data to your server.
  • But in our case we will be choosing “Email/SMS/push/voice”

9. Create your rule!

10. That’s it. You were done with step 9 :)

Disclaimer: email alerts do cost money, but nothing significant (I pay 50 cents per month)

--

--