Introduction
Application monitoring is a critical part of modern software development. Without proper telemetry, diagnosing performance issues and tracking failures becomes difficult. Microsoft provides Application Insights, a powerful monitoring service within Microsoft Azure that helps developers collect, analyze, and act on telemetry data from their applications.
This article provides a step-by-step guide to integrating Application Insights into a .NET Core Web API, including setup, configuration, deployment, and verification.
Prerequisites
Before proceeding, ensure you have:
An active Azure subscription
A .NET Core Web API project
Access to Azure Portal
Step 1: Create an Application Insights Resource in Azure Portal
Sign in to Azure Portal
Navigate to the Azure Portal.
Log in using your Azure credentials.
Create the Resource
Click Create a resource.
Search for Application Insights.
Select it and click Create.
Configure the Resource
Provide the following details:
Resource Group – Select an existing one or create a new resource group.
Name – Enter a unique name for your Application Insights instance.
Region – Choose the region where your application is hosted.
Resource Mode – Select:
Classic, or
Workspace-based (recommended for integration with Log Analytics).
Click Review + Create, validate the configuration, and then click Create.
Once deployment is complete, the resource is ready for integration.
Step 2: Install Application Insights SDK
To enable telemetry collection in your .NET Core Web API, install the required NuGet package:
Microsoft.ApplicationInsights.AspNetCoreYou can install it using:
NuGet Package Manager
Package Manager Console
.NET CLI:
dotnet add package Microsoft.ApplicationInsights.AspNetCoreAfter installation, your application is ready to connect with Azure Application Insights.
Step 3: Configure Application Insights in the Application
Retrieve the Connection String
Open your Application Insights resource in Azure Portal.
Go to the Overview section.
Copy the Connection String (recommended) or Instrumentation Key.

Join the conversation! Your thoughts help the community grow.