For those who are not aware, Azure Application Insights can be a nice addition to your toolbox when it comes to troubleshooting application performance issues. It provides tons of functionality to drill into application metrics and diagnostic information. You can even use its core functionality free of charge for basic/low volume workloads. For more advanced scenarios, I would recommend going with the Enterprise edition that provides additional capabilities data export to Log Analytics, which by itself provides tons of new ways to explore the telemetry data captured by Application Insights. For detailed pricing information, hit the following link.

A lot of people wrongly assume that Azure Application Insights is only useful for applications hosted in Microsoft Azure. Today’s blog post will show you how you can leverage it with on-premises applications.

There are various ways you can use to send telemetry data to the Application Insights service. The easiest way to get going is by installing a local agent which will be installed on your IIS servers called Application Insights Status Monitor. You can install it using Microsoft Web Platform Installer or by clicking the following link. The installation process is very straightforward.

Once Application Insights Status Monitor is installed, it will discover ASP .NET web applications running on your IIS server.

In order to enable Application Insights for a web application, select it from the left pane. You will then have to sign to Azure. If you simply click the blue Add Application Insights button, a new instance of Application Insights will get created into a resource group named ApplicationInsights and it will be named after the IIS web site name. You probably want to name the objects yourself for clarity sake and respect of your corporate naming convention. In order to do this, your first need to select New Application Insights resource and then click the Configure settings link:



You will then be presented with the following dialog box:

You will now have the opportunity to pick the proper subscription and name the resource group and the Application Insight Resource as you wish. Once you have completed the dialog box, click OK. Now the Application Insights resource has been created according to your standard, you can now hit the Add Application Insights button.

This will then configure your web site/application by modifying the web.config of the application and adding the Application Insights DLLs in the bin directory. You will then be asked to restart IIS to complete the setup process.

With that process completed, the agent will start sending the telemetry data to the proper Azure Application Insights instance.

If you need to get more in depth performance data, you can setup the Application Insight Profiler. It’s worth noting that while this works just fine, this is not a scenario that’s supported by Microsoft and is provided as is.

In order to get this going, you will need first need to enable profiling in your Application Insights instance using the Azure Portal by going in the Performance section and then by clicking the Profiler gear icon. In the blade that will show up, simply click Enable Profiler.

Then you will need to grab the following package from Github here and follow the instructions provided on the Github page in order to install and configure the profiler agent.

Once this two step process is completed, ETL traces will get uploaded to the Application Insight workspace. From there you will be able to see more detailed information as to which .NET method in your page is causing slowness.

In a future post, I’ll go over some of the core areas of interest in Application Insights that will help you find and prioritize your application issues. If you have any questions regarding this post, feel free to contact me through the comments section.