# Appinsights Instrumentation

Guidance for instrumenting webapps with Azure Application Insights.

- Repository: https://github.com/microsoft/azure-skills (1609 stars)
- Category: DevOps
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add microsoft/azure-skills --skill appinsights-instrumentation -g -a claude-code -y`
Codex: `npx skills add microsoft/azure-skills --skill appinsights-instrumentation -g -a codex -y`
Cursor: `npx skills add microsoft/azure-skills --skill appinsights-instrumentation -g -a cursor -y`
Gemini CLI: `npx skills add microsoft/azure-skills --skill appinsights-instrumentation -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add microsoft/azure-skills`

## 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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](references/auto.md) 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.

The rest: https://github.com/microsoft/azure-skills/blob/HEAD/.github/plugins/azure-skills/skills/appinsights-instrumentation/SKILL.md
