How to use Azure Application Insights in ASP.NET Core

Take advantage of Application Insights to monitor performance and detect and diagnose performance issues in your web application

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).

Note that you can use Application Insights for applications built in various technologies including .NET, JavaScript, Node.js, and Java as well as .NET Core. And you can use Application Insights for such applications whether or not they are hosted in the cloud. In this article we’ll examine how you can log data to Azure Application Insights in an ASP.NET Core application.

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.

Create an ASP.NET Core API project

To continue reading this article register now

How to choose a low-code development platform