appinsights-instrumentation
microsoft/azure-skills
Guidance for instrumenting webapps with Azure Application Insights telemetry, SDK setup, and APM patterns.
What is appinsights-instrumentation?
This skill provides reference material and best practices for adding Application Insights monitoring to ASP.NET Core and Node.js webapps hosted in Azure. Use it when you need guidance on instrumentation patterns, SDK configuration, or telemetry concepts—not for actually modifying your project code.
- Explains when to use auto-instrumentation vs. manual instrumentation approaches
- Provides SDK setup instructions for ASP.NET Core, Node.js, and Python applications
- References OpenTelemetry Distro and Exporter SDKs for multiple languages
- Guides creation of Application Insights resources via Bicep templates or Azure CLI
- Offers platform-specific observability guidance for Azure Container Apps
- Clarifies telemetry patterns and APM best practices
How to install appinsights-instrumentation
npx skills add https://github.com/microsoft/azure-skills --skill appinsights-instrumentation- An ASP.NET Core app, Node.js app, or Python app in your workspace
- Application hosted in Azure (App Service, Container Apps, or similar)
- Basic familiarity with your application's framework and hosting setup
How to use appinsights-instrumentation
- 1.Identify your application type (ASP.NET Core, Node.js, or Python) and hosting environment
- 2.Review the relevant platform-specific guide (ASPNETCORE, NODEJS, or PYTHON) in the skill references
- 3.For ASP.NET Core in App Service, check the AUTO guide for auto-instrumentation options
- 4.If manually instrumenting, use the provided Bicep template or Azure CLI script to create an Application Insights resource
- 5.Follow the language-specific code modification guide to add SDK initialization and telemetry collection to your application
Use cases
- Learning how to instrument an ASP.NET Core app with auto-instrumentation in Azure App Service
- Understanding SDK configuration options for Node.js applications before implementation
- Researching telemetry patterns and Application Insights concepts
- Determining the correct instrumentation approach based on your hosting environment (App Service, Container Apps, etc.)
- Reviewing OpenTelemetry Distro and Exporter options for your tech stack
- Backend developers instrumenting ASP.NET Core or Node.js applications
- DevOps engineers setting up observability for Azure-hosted webapps
- Teams evaluating Application Insights for APM and monitoring
- Developers new to Azure Application Insights concepts and patterns
appinsights-instrumentation FAQ
If your app is C# ASP.NET Core hosted in Azure App Service, prefer auto-instrumentation using the AUTO guide. Otherwise, follow the manual instrumentation approach for your language and hosting environment.
Use the azure-prepare skill instead, which orchestrates the actual code and infrastructure changes. This skill provides reference material only.
This skill provides guidance for ASP.NET Core, Node.js, and Python applications, with SDK references for OpenTelemetry Distro and Exporter packages.
You can add it to an existing Bicep template (see examples/appinsights.bicep) or use Azure CLI commands (see scripts/appinsights.ps1). Choose the approach that fits your infrastructure setup.
Yes. The skill includes a Container Apps observability guide for platform-specific instrumentation patterns.
Full instructions (SKILL.md)
Source of truth, from microsoft/azure-skills.
name: appinsights-instrumentation description: "Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices." license: MIT metadata: author: Microsoft version: "1.2.1"
AppInsights Instrumentation Guide
This skill provides guidance and reference material for instrumenting webapps with Azure Application Insights.
⛔ ADDING COMPONENTS?
If the user wants to add App Insights to their app, invoke azure-prepare instead. This skill provides reference material—azure-prepare orchestrates the actual changes.
When to Use This Skill
- User asks how to instrument (guidance, patterns, examples)
- User needs SDK setup instructions
- azure-prepare invokes this skill during research phase
- User wants to understand App Insights concepts
When to Use azure-prepare Instead
- User says "add telemetry to my app"
- User says "add App Insights"
- User wants to modify their project
- Any request to change/add components
Prerequisites
The app in the workspace must be one of these kinds
- An ASP.NET Core app hosted in Azure
- A Node.js app hosted in Azure
Guidelines
Collect context information
Find out the (programming language, application framework, hosting) tuple of the application the user is trying to add telemetry support in. This determines how the application can be instrumented. Read the source code to make an educated guess. Confirm with the user on anything you don't know. You must always ask the user where the application is hosted (e.g. on a personal computer, in an Azure App Service as code, in an Azure App Service as container, in an Azure Container App, etc.).
Prefer auto-instrument if possible
If the app is a C# ASP.NET Core app hosted in Azure App Service, use AUTO guide to help user auto-instrument the app.
Manually instrument
Manually instrument the app by creating the AppInsights resource and update the app's code.
Create AppInsights resource
Use one of the following options that fits the environment.
- Add AppInsights to existing Bicep template. See examples/appinsights.bicep for what to add. This is the best option if there are existing Bicep template files in the workspace.
- Use Azure CLI. See scripts/appinsights.ps1 for what Azure CLI command to execute to create the App Insights resource.
No matter which option you choose, recommend the user to create the App Insights resource in a meaningful resource group that makes managing resources easier. A good candidate will be the same resource group that contains the resources for the hosted app in Azure.
Modify application code
- If the app is an ASP.NET Core app, see ASPNETCORE guide for how to modify the C# code.
- If the app is a Node.js app, see NODEJS guide for how to modify the JavaScript/TypeScript code.
- If the app is a Python app, see PYTHON guide for how to modify the Python code.
SDK Quick References
- OpenTelemetry Distro: Python | TypeScript
- OpenTelemetry Exporter: Python | Java
Platform-Specific Guides
- Container Apps: Observability Guide
Related skills
More from microsoft/azure-skills and the wider catalog.
