Application Insights with Universal Windows 10 Apps

Application Insights with Universal Windows 10 Apps

appInsights1

Short introduction

Application Insights is a great tool which can help you as a developer to track usage and crashes of your Universal Windows 10 Application.

It is great because you have more control overs your apps. Let’s see how to use this amazing tool.

What do I need to start?

1) Windows 10 operating system – can be neither Education edition or Enterprise

2) Visual Studio 2015 Comminity (for free) or higher

3) Microsoft Azure subscription (you can test it for free here)

Let’s start

 1) LAUNCH VISUAL STUDIO 2015

appInsights2

 2) CREATE NEW BLANK PROJECT CALLED “APPINSIGHTSDEMO”:

appInsights3

 3) NOW OPEN MICROSOFT AZURE PORTAL:

appInsights4

  1. Select new -> Developer Services -> Application Insights
  2. Type the name: “AppInsightsDemo” in my case
  3. Select “Windows Store Application”
  4. Click “Create” button

 appInsights5

4) WHEN IT’S FINISHED YOU WILL SEE THE INFORMATION:

appInsights6

  1. Click on the Essentials tab
  2. Copy “Instrumentation Key” shown below

appInsights7

 5) NOW LETS GET BACK TO THE VISUAL STUDIO:

Application Insights NuGet is added automatically to the new project

  1. Open “App.xaml.cs” file and you will see that it is added
  2. Open “ApplicationInsights.config” file and paste your “Instrumentation Key” between “ApplicationInsights” tags as shown below
  3. Remember to select “Copy always” option in properties of “ApplicationInsights.config” file as below

appInsights8

 appInsights9

appInsights10

appInsights11

6) REMEMBER TO ENABLE “INTERNER(CLIENT)” CAPABILITY IN THE APP MANIFEST FILE:

 7) LAUNCH THE APP AND YOU SHOULD SEE INFORMATION ABOUT FIRST APPLICATIONS INSIGHTS EVENT:

appInsights12

When you open Application Insights in Azure portal you can notice that there is one session (first launch of the app).

There you can configure many different options to track your app like “Failures” or “Performance”.

appInsights13

Please also note that in “Debug” mode telemetry is sent as soon as it is generated. In “Release” mode data is collected on the device and sent to Azure only when app resumes. You can also add your own telemetry data.

Sum up

In this article I presented how to implement Application Insights within your Universal Windows 10 Application. This feature helps you to track app performance and crashes.

Advertisements