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, but I found myself wanting a tiny bit more in depth example. (EDIT: This doc has been subsequently updated to no longer support HTTP calls and only provides code demonstrating the TrackAvailability() method.)
  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.

Step-by-step video of the first iteration of how to build out a custom availability monitoring service:

Code for the video above, and new more advanced hybrid/on-premises availability monitoring solutions can be found at:

Intro to Azure Monitor – Application Insights with ASP.NET Core

So we just published a brand new doc at this week to cover everything you need to get up and running with ASP.NET Core and Application Insights.

Previously, we did a decent job of covering how to get things set up with predefined templates in Visual Studio, but if you were on a Mac or using Linux or prefer using VS Code our instructions were a little lacking/non-existent until very recently.

Please check out the doc, and if there is something that we aren’t covering that you want to see let us know. We already have a great comment from a developer who wants coverage of how exception tracking works in the App Insights ASP.NET Core SDK.

To accompany the doc I put together two new intro videos. One walking through setting up a basic ASP.NET Core app in VS Code and adding server-side and client-side monitoring:

And a new video walking through the process for ASP.NET Core in Visual Studio. (The Visual Studio video is extremely similar to the first video in the series on monitoring ASP.NET, this is mainly just to show you that the underlying code changes made to your project are different.):

Intro to Azure Monitor – Application Insights for SCOM Admins Part II

For some quick history, SCOM does have the capability to perform code-level monitoring of some .NET apps. This APM feature set traces its roots to the 2010 acquisition of AVIcode which was then introduced as SCOM Application Performance Monitoring in 2012. The underlying tech was incredibly powerful, but it was extremely hard to use effectively within SCOM. In more recent years, SCOM APM has become a little more friendly, but it never quite reached its potential and has unfortunately been plagued by bugs. (The APM SharePoint bug was finally fixed in SCOM 2016 UR6, but it persisted for so long that APM has almost become synonymous in the SCOM world with “how do I disable the APM agent?”)

While Application Insights shares some common development ancestry with SCOM APM, it has matured far beyond the basic APM capabilities offered in SCOM. In the first post I walked through the basics of instrumenting a .NET application with Application Insights in Visual Studio. This is great if you have access to the source code of the app you are looking to monitor, but there are often applications both on premises and in the cloud that you may need to monitor in your environment where you don’t have source code access.

Application Insights answer to this problem, comes in the form of a little known feature called Status Monitor. It works on premises and in any cloud, all you need is a .NET app hosted in IIS and outbound connectivity to Azure. Since not everyone has a .NET app lying around I thought it would be fun to first demo this functionality with one app I know every SCOM Admin will be familiar with, the SCOM web console.

Note: Since I originally wrote this post a new improved version of Status Monitor was released. All the same functionality as before + some feature improvements. Installation is now entirely PowerShell based to enable automated deployments. To learn more see the official docs for the Azure Monitor – Application Insights Agent.

Now a quick disclaimer, I am not suggesting you monitor your production SCOM Web Console with Application Insights, I would actually advise against it. I’ve always found the SCOM web console to be somewhat finicky/brittle and I don’t want anyone to break their prod environment. In this case I have a freshly built SCOM 2016 UR6 test environment running on Hyper-V so I can checkpoint and rollback if SCOM decides it doesn’t want to play nice.

But in a few clicks you can setup monitoring and start taking advantage of features like:

Live Metrics:

Failure Analysis:

Performance Analysis:

Once you play around with Application Insights with SCOM you start to think of other on premises tech that is based on .NET where Status Monitor can add value. As a quick test I spun up an on premises SharePoint 2019 server and adding server side monitoring took just a few minutes.

With SharePoint 2019 you see the advantage of features like Application Map:

End-to-End transaction analysis:

So how do we get this set-up? Watch the video to find out:

Intro to Azure Monitor – Application Insights for SCOM Admins

Back in 2017 I moved away from working with SCOM to a role focused on Application Insights and monitoring in Azure. I always used to hear Application Insights is only for developers, but the more I use it, the more I see ways in which it could be useful to a broader audience.

It’s not to say the core audience isn’t still the more dev centric, it is, but even if coding isn’t part of your day-to-day work I think it’s useful to know how all the available tools in your toolbox work. Application monitoring is something everyone who works on monitoring needs to care about, not just developers.

Towards that end, I started a side-project recently to help anyone get up to speed on Azure Monitor – Application Insights. It doesn’t assume any developer knowledge, every step is recorded so even if you have never written a line of code before it’s possible to follow along. Having some degree of dev/scripting background will certainly help, but it isn’t required. I walk through each step, and if you don’t come from a traditional coding background this might give you that extra nudge to dig in and learn more.

For the first video all you need is a free copy of Visual Studio 2017 Community edition, and an Azure subscription. If you don’t have a subscription you can sign-up for a free subscription here.

During the Visual Studio install select ASP.NET and web development.

Keep the default optional components:

Now you should be all set, and ready to follow along:

If you are interested in learning more check-out the official docs here. If you like the video and would like to see more for topics like monitoring JavaScript, Java, .NET Core, availability monitoring, distributed tracing, etc, leave a comment here.

I think I have enough time to make a new video every two weeks, but having a sense of how much interest there is will help in setting aside time.

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