Application Insights with Universal Windows 10 Apps
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)
1) LAUNCH VISUAL STUDIO 2015
2) CREATE NEW BLANK PROJECT CALLED “APPINSIGHTSDEMO”:
3) NOW OPEN MICROSOFT AZURE PORTAL:
- Select new -> Developer Services -> Application Insights
- Type the name: “AppInsightsDemo” in my case
- Select “Windows Store Application”
- Click “Create” button
4) WHEN IT’S FINISHED YOU WILL SEE THE INFORMATION:
- Click on the Essentials tab
- Copy “Instrumentation Key” shown below
5) NOW LETS GET BACK TO THE VISUAL STUDIO:
Application Insights NuGet is added automatically to the new project
- Open “App.xaml.cs” file and you will see that it is added
- Open “ApplicationInsights.config” file and paste your “Instrumentation Key” between “ApplicationInsights” tags as shown below
- Remember to select “Copy always” option in properties of “ApplicationInsights.config” file as below
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:
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”.
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.
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.