
Appinsights Instrumentation
- 481k installs
- 1.3k repo stars
- Updated July 26, 2026
- microsoft/azure-skills
appinsights-instrumentation is a skill that guides an agent through adding Azure Application Insights telemetry and APM to web apps hosted on Azure.
About
appinsights-instrumentation is a Microsoft-authored reference skill that tells an agent how to add Azure Application Insights telemetry to a web app already hosted on Azure. It covers collecting the app's language and hosting context, preferring auto-instrumentation for ASP.NET Core on App Service, and falling back to manual SDK setup for Node.js and Python. It provides a Bicep example, an Azure CLI PowerShell script, and OpenTelemetry SDK references for creating the App Insights resource and modifying code. A developer reaches for it when they need APM and observability wiring rather than a request to add components, which it defers to the azure-prepare skill.
- Reference guide for wiring Azure Application Insights into Azure-hosted web apps
- Covers auto-instrument for ASP.NET Core plus manual SDK setup for Node.js and Python
- Bundles Bicep example, PowerShell/Azure CLI script, and OpenTelemetry SDK references
Appinsights Instrumentation by the numbers
- 481,032 all-time installs (skills.sh)
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
appinsights-instrumentation capabilities & compatibility
Free skill; requires an Azure subscription and an Application Insights resource, which is billed by Azure.
- Capabilities
- telemetry instrumentation · apm setup · azure provisioning · opentelemetry config
- Works with
- azure
- Use cases
- devops
- Pricing
- Free
What appinsights-instrumentation says it does
This skill provides **guidance and reference material** for instrumenting webapps with Azure Application Insights.
If the app is a C# ASP.NET Core app hosted in Azure App Service, use [AUTO guide](references/auto.md) to help user auto-instrument the app.
The app in the workspace must be one of these kinds
npx skills add https://github.com/microsoft/azure-skills --skill appinsights-instrumentationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 481k |
|---|---|
| repo stars | ★ 1.3k |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 26, 2026 |
| Repository | microsoft/azure-skills ↗ |
How do I add Application Insights telemetry and APM to my Azure-hosted web app?
A developer uses it when they need to add Application Insights telemetry and APM to an ASP.NET Core or Node.js app already hosted on Azure.
Who is it for?
Developers with an ASP.NET Core, Node.js, or Python web app already running on Azure who need Application Insights telemetry.
Skip if: Requests to add App Insights components to a project, which the skill defers to the azure-prepare skill instead.
When should I use this skill?
The user asks how to instrument an app, set up the App Insights SDK, or understand Application Insights and APM patterns.
What you get
The app has an App Insights resource and instrumented code emitting telemetry for observability.
- An Application Insights resource (via Bicep or Azure CLI)
- Instrumented application code emitting telemetry
By the numbers
- 6 language/platform reference guides
- 4 bundled OpenTelemetry SDK references
Files
Auto-instrument app
Use Azure Portal to auto-instrument a webapp hosted in Azure App Service for App Insights without making any code changes. Only the following types of app can be auto-instrumented. See supported environments and resource providers.
- ASP.NET Core app hosted in Azure App Service
- Node.js app hosted in Azure App Service
Construct a url to bring the user to the Application Insights blade in Azure Portal for the App Service App.
https://portal.azure.com/#resource/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Web/sites/{app_service_name}/monitoringSettingsUse the context or ask the user to get the subscription_id, resource_group_name, and the app_service_name hosting the webapp.
Modify code
Make these necessary changes to the app.
- Install client library
dotnet add package Azure.Monitor.OpenTelemetry.AspNetCore- Configure the app to use Azure Monitor
An ASP.NET Core app typically has a Program.cs file that "builds" the app. Find this file and apply these changes.
- Add
using Azure.Monitor.OpenTelemetry.AspNetCore;at the top - Before calling
builder.Build(), add this linebuilder.Services.AddOpenTelemetry().UseAzureMonitor();.
Note: since we modified the code of the app, the app needs to be deployed to take effect.
Configure App Insights connection string
The App Insights resource has a connection string. Add the connection string as an environment variable of the running app. You can use Azure CLI to query the connection string of the App Insights resource. See scripts/appinsights.ps1 for what Azure CLI command to execute for querying the connection string.
After getting the connection string, set this environment variable with its value.
"APPLICATIONINSIGHTS_CONNECTION_STRING={your_application_insights_connection_string}"If the app has IaC template such as Bicep or terraform files representing its cloud instance, this environment variable should be added to the IaC template to be applied in each deployment. Otherwise, use Azure CLI to manually apply the environment variable to the cloud instance of the app. See scripts/appinsights.ps1 for what Azure CLI command to execute for setting this environment variable.
Important: Don't modify appsettings.json. It was a deprecated way to configure App Insights. The environment variable is the new recommended way.
MIT License
Copyright 2025 (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
Modify code
Make these necessary changes to the app.
- Install client library
npm install @azure/monitor-opentelemetry- Configure the app to use Azure Monitor
A Node.js app typically has an entry file that is listed as the "main" property in package.json. Find this file and apply these change
Related skills
How it compares
Pick appinsights-instrumentation for codeless App Service setup; use manual SDK instrumentation when the stack is outside supported auto-instrumentation environments.
FAQ
What apps can this skill instrument?
It targets ASP.NET Core, Node.js, and Python web apps hosted in Azure, such as Azure App Service or Container Apps.
Does it add App Insights to my project for me?
No. It provides guidance and reference material; if you want the changes applied, it directs the agent to the azure-prepare skill.
Can it auto-instrument without code changes?
For a C# ASP.NET Core app on Azure App Service it prefers auto-instrumentation; otherwise it walks through manual SDK setup.
Is Appinsights Instrumentation safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.