Application Insights (AI) is a fantastic logging/metrics/analytics application that Azure offers for free (unless you want to increase the longevity of your data; free is 1 week lifetime). Not only is it extremely simple to get exceptions, requests, page load times, client-side exceptions and much more getting logged and aggregated, but it offers a UI that makes sorting through all that data appealing and dead-simple.
This article will cover the basic set up to get the most out of Application Insights for your Web Application or Web API Application.
Creating your web application
For the purpose of simplicity, and to stay in the scope of this article, your web application should be created by someone who has the following attributes:
- Is logged into Visual Studio with the profile that holds the subscription that connects them to Azure
- The profile has permissions to create resources in Azure
The reason for this is that Visual Studio will automatically create an AI application and connect it to your application. See the AI documentation on Microsoft’s website for more information.
If the application is created in this way, the AI application is created in Azure, configuration to log out to that AI application from your application is done for you and you’re good to go. Open the AI application and you’ll start seeing data stream in as you test and play with your application.