Visual Studio 2015 New Features: Part 2 - Application Insights Integration

While working with Visual Studio 2015 you will find an important feature, the full integration of Application Insights. Initially Application Insights was released as extension and then integrated with Visual Studio in update 3.

You can learn more in my previous parts:

An important note is that Application Insights is still in preview mode.

By enabling Application Insights for our application we will get very important details such as usage, exceptions, requests, performance, logs and so on. We could very easily detect the problems, can get details like what the users are doing. Currently Application Insights are supported for: 
  • Windows, iOS and Android apps
  • ASP.NET and J2EE web applications
  • WCF Services

Here for now we will start with our ASP.NET web application. Whenever we create a new ASP.NET web application in Visual Studio 2015 we have the option "Add Application Insights to Project" for enabling Application Insights for our web application as in the following:

Add application Insights to Project
Figure 1: "Add application Insights to Project" option

For enabling Application Insights we will require the account for Azure.

For an existing application we can enable Application Insights using the "Add Application Insights Telemetry…" option to the project as shown in the following figure:

Add application Insights Telemetry
Figure 2: Option "Add application Insights Telemetry…" for an existing application where Application Insights is not enabled

Enabling Application Insights for our application means sending the telemetry to the Azure Portal. This happens using the Application Insights SDK that is added to our application as in the following:

References to Application Insight
Figure 3: References to Application Insights assemblies

We can review our Application Insights by the following:

Open Application Insights
Figure 4: "Open Application Insights" option

Also from Visual Studio we can have the option for the Application Insights tool bar as in the following:

Application Insights tool bar
Figure 5: Application Insights tool bar

Once we enable the Application tool bar, we can set the notification for viewing Application Insights as in the following:

Application Insights Notification option
Figure 6: Application Insights Notification option

In Visual Studio we will get notifications like the following:

Application Insights Notification in Visual Studio
Figure 7: Application Insights Notification in Visual Studio

After clicking on the "Open Application Insights" link from the notification pop-up, we will be redirected to the new Azure portal that is still in preview as shown in the following figures (8_a and 8_b).

Application Insights overview page in Azure
Figure 8(a): Application Insights overview page in Azure

Application Insights overview
Figure 8(b): Application Insights overview page in Azure - Page Views, Sessions, Users, and so on options

Here we can review the respective details also, like if I click on "Failed Requests" as shown in the preceding figure (8_a), I'll have the details as in the following:

Failures Details
Figure 9: Application Insights: Failures Details

We can have exception details also as in the following:

Exceptions details
Figure 10: Application Insights: Exceptions details

This was only an introduction and there are more features/metrics. We can set alerts, add users, export chart/tables to Excel, and so on. I would say, try all these features of Application Insights and then use it depending on your application requirements since there is so much to cover about it.

References

Enjoy reading. Feel free to comment and provide your feedback.


Similar Articles