How to use Azure Application Insights in ASP.Net Core
Azure Application Insights is an extensible application performance management (APM) service that can be used to monitor performance, detect anomalies, and diagnose performance issues for a web application in real time. If you are using .Net Core, you can use Application Insights on the multiple platforms that .Net Core supports (Windows, Linux, or Mac).
To work with the code examples illustrated in this article, you should have Visual Studio 2019 installed in your system. If you don’t already have a copy, you can download Visual Studio 2019 here.
You will also need an Azure account as we’ll be pushing the log messages to Application Insights in Azure. If you don’t have an Azure account, you can create a free Azure account here. In the sections that follow, we’ll examine how we can configure Application Insights as one of the sinks for the default logger in ASP.Net Core.