
Appinsights Instrumentation
Wire Azure Application Insights onto an ASP.NET Core or Node.js app in App Service—via Portal auto-instrument or OpenTelemetry in code—so telemetry flows without guessing portal URLs or package names.
Overview
appinsights-instrumentation is an agent skill most often used in Operate (also Ship) that enables Application Insights on Azure App Service web apps through Portal auto-instrument or OpenTelemetry code changes.
Install
npx skills add https://github.com/microsoft/azure-skills --skill appinsights-instrumentationWhat is this skill?
- Builds the exact Azure Portal monitoringSettings deep link from subscription, resource group, and App Service name
- Documents codeless auto-instrument for ASP.NET Core and Node.js on Azure App Service per Microsoft supported environment
- Adds Azure.Monitor.OpenTelemetry.AspNetCore via dotnet add package and wires UseAzureMonitor in Program.cs
- Calls out redeploy requirement after Program.cs changes so instrumentation actually reaches production
- Points to official codeless overview for supported resource providers and languages
- 2 codeless app types called out: ASP.NET Core and Node.js on App Service
- 1 dotnet package: Azure.Monitor.OpenTelemetry.AspNetCore
- 1 Program.cs hook: builder.Services.AddOpenTelemetry().UseAzureMonitor()
Adoption & trust: 374k installs on skills.sh; 1.2k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your App Service app is live but you have no Application Insights dependency tracking or request telemetry, and you are unsure whether to use codeless Portal setup or OpenTelemetry in Program.cs.
Who is it for?
Solo builders hosting ASP.NET Core or Node.js on Azure App Service who want App Insights enabled with minimal doc hopping.
Skip if: Apps outside App Service codeless support, non-.NET stacks needing manual SDK setup beyond what the skill describes, or teams that already have full OpenTelemetry pipelines and only need alert tuning.
When should I use this skill?
User needs Application Insights on an Azure App Service web app via Portal auto-instrument or ASP.NET Core OpenTelemetry code changes.
What do I get? / Deliverables
The agent produces the correct Portal monitoring link and/or a patched Program.cs with Azure Monitor OpenTelemetry so you can redeploy and see telemetry in Application Insights.
- Azure Portal monitoringSettings deep link for the target App Service
- Updated Program.cs with Azure Monitor OpenTelemetry registration (code path)
- dotnet add package command for Azure.Monitor.OpenTelemetry.AspNetCore
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Application Insights is production observability; the canonical shelf is Operate because the skill’s payoff is live traces, metrics, and dependency maps after the app is hosted. Instrumentation is monitoring setup, not incident triage or infra provisioning alone—subphase monitoring matches App Insights blades, codeless enablement, and OpenTelemetry export.
Where it fits
Enable codeless App Insights on a prototype App Service slot to validate request volume before full build-out.
Add OpenTelemetry in Program.cs and redeploy so launch day traffic appears in Application Insights.
Open the constructed monitoringSettings blade to confirm auto-instrumentation for an existing production site.
Align App Service monitoring with subscription and resource group IDs when onboarding a migrated workload.
How it compares
Azure-focused instrumentation runbook for App Service—not a generic local logging tutorial or an MCP observability server.
Common Questions / FAQ
Who is appinsights-instrumentation for?
Indie and solo developers deploying ASP.NET Core or Node.js web apps to Azure App Service who need Application Insights wired through Portal or OpenTelemetry.
When should I use appinsights-instrumentation?
Use it in Operate when turning on production monitoring, in Ship when you must redeploy after adding UseAzureMonitor, or during Validate prototypes on App Service before launch observability matters.
Is appinsights-instrumentation safe to install?
It guides Azure Portal navigation and package changes; review the Security Audits panel on this Prism page and verify subscription and site names before applying changes in your tenant.
SKILL.md
READMESKILL.md - Appinsights Instrumentation
# 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](https://learn.microsoft.com/azure/azure-monitor/app/codeless-overview#supported-environments-languages-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}/monitoringSettings ``` Use 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 line `builder.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](../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](../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