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:
- 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.
- 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: