Intro to Azure Monitor – Application Insights -Availability Monitoring

So a week or two ago I put together an intro video walking through the basics of Availability monitoring in Application Insights. It covered how to use the portal Availability UI, and how you could use a new doc that was recently published to make your own custom availability monitor and have it live inside an Azure Function.

The Azure Function based availability monitor was cool, but there were some key things it couldn’t do:

  1. It is hardcoded to monitoring a single site. You can of course modify this behavior to your hearts content, but I found myself wanting a tiny bit more in depth example.
  2. You still can’t perform true Hybrid/on prem availability tests. Coming from the SCOM world I am used to having watcher nodes which I can turn into an army of on premises URL/endpoint monitoring minions that don’t require opening any incoming firewall rules.

So last Thursday night I started tinkering with seeing how hard it would be create some on prem monitoring minions by trying to take the Availability monitoring via Azure Functions code and cramming it into one of the new .NET Core 3.0 Worker Services. These new worker services were attractive in that I kept hearing the .NET Core team say that they were super easy to turn into long running Windows Services which I have messed around with in the past and always found to be kind of a pain to build from scratch.

Even with hearing all the positive buzz about worker services I was still expecting getting a Windows Service working to be a hurdle. I was wrong, it took about 60 seconds to turn the worker service into a full fledged windows service.

Turning the Azure Function availability code into something more usable is going to be a longer project, but I wanted to quick share what I have so far as I am plodding along slowly and learning.

So far I have successfully created a multi-site availability monitoring windows service which you can deploy anywhere on prem. It’s still very much a toy project at this point, but I honestly don’t think it would take too much effort for someone whose full-time job is programming to create something useful for production use.

If you want a step-by-step video here ya go:

If slow typing from a self taught programmer who is still far more comfortable in PowerShell than C# is not your thing and you just want to look at the code:

https://github.com/mrbullwinkle/availability-watcher/blob/master/README.md

Leave a Reply

Your email address will not be published. Required fields are marked *

The contents of this site are provided “AS IS” with no warranties, or rights conferred. Example code could harm your environment, and is not intended for production use. Content represents point in time snapshots of information and may no longer be accurate. (I work @ MSFT. Thoughts and opinions are my own.)