appinsights-instrumentation
π―SkillA guide for adding Azure Application Insights, Microsoft's app monitoring service, to your web app. It gives setup steps and code examples for ASP.NET Core, Node.js and Python apps hosted in Azure.
Installation
npx skills add microsoft/azure-skills --skill appinsights-instrumentationRun it in a terminal; it asks which AI coding tools to install it for (Claude Code, Codex, Cursor and more).
Uses skills.sh Β· Node.js 22.20+
After installing
Ask for related work and the agent uses it on its own, or call it yourself.
/appinsights-instrumentationInstall by hand
Copy the whole skill folder from GitHub to the place below. Copying only SKILL.md can leave out files the skill uses.
Open the skill folder β- This project
.claude/skills/appinsights-instrumentation/ - All projects
~/.claude/skills/appinsights-instrumentation/
These paths are for Claude Code. For other tools, the command above puts it in the right place.
What this skill does
Overview
appinsights-instrumentation is a reference skill for adding Azure Application Insights to a web app, so you can collect telemetry (data your running app sends about how it behaves). The skill first finds your app's language, framework and hosting place, then points you to automatic setup or manual code changes. When you want to actually change your project, it hands the work to the azure-prepare skill.
Key Features
- Find your app's language, framework and hosting place, with the assistant always asking you where the app runs.
- Follow an automatic setup guide for ASP.NET Core apps on Azure App Service.
- Create the Application Insights resource with a Bicep template (a file that describes Azure resources) or an Azure CLI (command-line tool) script.
- Update your code with guides for ASP.NET Core, Node.js and Python apps.
- Look up SDK (code library) references for OpenTelemetry, an open standard for collecting app data, and a guide for Azure Container Apps.
Who is this for?
This is for developers who run an ASP.NET Core, Node.js or Python app in Azure, or an Azure Container App, and want to see how it behaves. It also helps when you want to learn how monitoring works before azure-prepare changes your project.
Summarized by AI from this skill's SKILL.md. Suggest a better one
SKILL.md
View on GitHub β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.
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
- An Azure Container App
- A Node.js app hosted in Azure
- A Python 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
More from this repository10
Helps you build, deploy, test, and manage AI agents and models on Microsoft Foundry, Microsoft's Azure service for AI. It guides the AI through each task with fixed steps.
Helps you find and fix problems in apps running on Azure, such as crashes, slow responses, or connection failures. It checks things in a set order and can work only from logs you provide.
azure-prepare gets a new or existing app ready to deploy to Azure with azd, Microsoft's command-line tool for Azure. It first writes a plan for your approval, then creates the setup files.
azure-deploy puts your app on Azure after the azure-prepare and azure-validate skills have prepared and checked it. It runs the deployment, recovers from errors, and gives you the live web addresses.
azure-validate checks your Azure app before you deploy it, so you can catch setup and permission problems early. It runs after azure-prepare and before azure-deploy.
azure-resource-lookup finds and lists your Azure resources, such as web apps, virtual machines, and storage accounts, across your subscriptions. It only reads data and never changes anything.
azure-resource-visualizer draws a diagram of an Azure resource group that shows how each resource connects to the others. It saves the diagram and notes in a markdown file.
Lets Claude search and summarize large amounts of logs and app data stored in Azure Data Explorer. You ask what you want to know, and it writes and runs the queries for you.
Helps you send all requests to your AI models and tools through Azure API Management, so you can control cost, block harmful content and limit traffic. It includes Azure command-line steps for setup and testing.
Helps you find and fix errors in apps that send and receive messages through Azure Event Hubs or Service Bus. It checks service health and Microsoft docs to suggest a fix.