Application and App Monitoring with Microsoft Application Insights

Application and App Monitoring with Microsoft Application Insights


The Visual Studio team recently released an application monitoring tool called Application Insights (preview) for Visual Studio Online. If you have an Azure account with subscription for Visual Studio Online, you can request a limited preview of the Application Insights platform, that allows you to monitor the performance, availability, usage and diagnostic aspects of not just web, but services, Windows Phone, Windows Store, and Azure PaaS based applications and apps.

Configuring Application Insights (On Premise)

Application Insights primarily consists of the Monitoring Agent that you need to install for on premise Windows Servers. During installation, you need to specify the Account Id, and the Instrumentation Key. The Agent installer provides three options. Use the Application Insights for Visual Studio Onlineoption to surface the monitoring data of your applications on premise to be collected and analysed in Visual Studio Online.

Figure 1: Monitoring Agent Setup

Note that, IIS Management Tools and Scriptsis a pre-requisite for installing the monitoring agent.

Configuring Application Insights (Azure PaaS)

For Windows Azure PaaS based applications, you need to modify the deployment configuration files in your Windows Azure project. A step by step guide is provided, if you select Add an Applicationfrom the Application Insights page under Visual Studio Online. Answer the questions presented by the Wizard as shown in Figure 2, and you will reach the step by step instructions.

Figure 2: Wizard Driven Interface to Add a New Application for Monitoring

You will need to download the instrumentation tool and extract the files to be placed into the AppInsightsAgentfolder inside your web role. You then need to add a Startup Task to launch the instrumentation bootstraps (unifiedbootstrap.bat file). Deploy the application, and the metrics will start showing up in the site.

Measuring Availability with Synthetic Monitors

Application Insights allows you to provide the application URL as a ping request that can then monitor performance, availability and functionality using the tool called Synthetic Monitor. You can create multiple synthetic monitors, and create a single URL test, or a multi-step test using a Visual Studio Web Test file as shown in Figure 3.

Figure 3: Multi-step Synthetic Monitor

Analysing Usage with Telemetry SDK

The Telemetry SDK with Application Insights allows you to surface usability patterns of the deployed application. You can download the Telemetry SDK using NuGet and then start using the ServerAnalytics.Start method to allow Application Insights to start capturing usage data.

using Microsoft.ApplicationInsights.Telemetry.Services; public override bool OnStart() {    ServerAnalytics.Start("");     return base.OnStart();}

The above code sample, demonstrates enabling the analytics on a Worker Role.

You can also use the SDK to log KPIs for important events occurring inside your application. The method ServerAnalytics.CurrentRequest.LogEvent will help you log events and surface them under Feature –> Events in the Application Insights site.


The Application Insights portal also lets you diagnose issues and exceptions as they are recorded by the monitoring agent. You can navigate to the Diagnostics page and see the events as they occur as illustrated in Figure 4.

Figure 4: Diagnostics using Application Insights


Application Insights is a very promising and powerful utility to monitor the performance, function and usability of a wide range of applications and apps, and the journey that started from IntelliTrace finally seems to have unified the application monitoring and diagnostics experience under one roof.


About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist