# Appinsights Instrumentation > Guía para instrumentar aplicaciones web con Azure Application Insights: patrones de telemetría, configuración del SDK y referencias. Para añadirlo a tu app, usa azure-prepare. Fuente: https://skillsagentes.com/skills/microsoft/azure-skills/appinsights-instrumentation Markdown: https://skillsagentes.com/skills/microsoft/azure-skills/appinsights-instrumentation.md Repositorio: https://github.com/microsoft/azure-skills Autor: microsoft Licencia: MIT Actualizado: hace 2 meses Coste de contexto: 76 tok instalada, 935 tok al activarse, 6.1k tok con todos los archivos del bundle Bundle: 13 archivos, 24 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add microsoft/azure-skills --skill appinsights-instrumentation --agent claude-code # Cursor npx -y skills add microsoft/azure-skills --skill appinsights-instrumentation --agent cursor # Codex npx -y skills add microsoft/azure-skills --skill appinsights-instrumentation --agent codex # Gemini CLI npx -y skills add microsoft/azure-skills --skill appinsights-instrumentation --agent gemini # Windsurf npx -y skills add microsoft/azure-skills --skill appinsights-instrumentation --agent windsurf # Cline npx -y skills add microsoft/azure-skills --skill appinsights-instrumentation --agent cline ``` ## Qué hace - Aporta **material de referencia** para instrumentar aplicaciones web con Azure Application Insights: patrones de telemetría, configuración del SDK y ejemplos. - Traza una frontera explícita: si el usuario quiere que se añada App Insights a su app, hay que invocar `azure-prepare`, que es quien orquesta los cambios reales. - También lo invoca `azure-prepare` durante su fase de investigación. ## Cuándo usarla - Se pregunta **cómo** instrumentar: guía, patrones y ejemplos. - Hacen falta instrucciones de configuración del SDK o entender los conceptos de App Insights. ## Cuándo no - Cuando se pide añadir telemetría o App Insights a la app, o modificar el proyecto: eso es `azure-prepare`. ## Qué la activa - "¿cómo instrumento mi app con App Insights?" - "enséñame patrones de telemetría" - "¿qué es Application Insights?" ## Antes de instalar - Es solo material de referencia: no modifica el proyecto. Los cambios los orquesta `azure-prepare`. - Necesita en el PATH: az ## Archivos - LICENSE.txt — 1 KB - SKILL.md — 4 KB - examples/appinsights.bicep — 759 B - references/aspnetcore.md — 2 KB - references/auto.md — 891 B - references/container-apps.md — 7 KB - references/nodejs.md — 2 KB - references/python.md — 2 KB - references/sdk/azure-monitor-opentelemetry-exporter-java.md — 1 KB - references/sdk/azure-monitor-opentelemetry-exporter-py.md — 963 B - references/sdk/azure-monitor-opentelemetry-py.md — 880 B - references/sdk/azure-monitor-opentelemetry-ts.md — 986 B - scripts/appinsights.ps1 — 1 KB ## SKILL.md Reproducido tal cual desde microsoft/azure-skills bajo MIT. Esta sección es el documento original y está en inglés. # 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](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. - Add AppInsights to existing Bicep template. See [examples/appinsights.bicep](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](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](references/aspnetcore.md) for how to modify the C# code. - If the app is a Node.js app, see [NODEJS guide](references/nodejs.md) for how to modify the JavaScript/TypeScript code. - If the app is a Python app, see [PYTHON guide](references/python.md) for how to modify the Python code. ## SDK Quick References - **OpenTelemetry Distro**: [Python](references/sdk/azure-monitor-opentelemetry-py.md) | [TypeScript](references/sdk/azure-monitor-opentelemetry-ts.md) - **OpenTelemetry Exporter**: [Python](references/sdk/azure-monitor-opentelemetry-exporter-py.md) | [Java](references/sdk/azure-monitor-opentelemetry-exporter-java.md) ## Platform-Specific Guides - **Container Apps**: [Observability Guide](references/container-apps.md) ## Dónde encaja - Categoría: [DevOps e infraestructura](https://skillsagentes.com/categorias/devops-infraestructura.md) — Despliegues, contenedores, IaC y flujos de gestión de incidentes. - Creador: [microsoft](https://skillsagentes.com/creators/microsoft.md) — 43 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Microsoft Foundry](https://skillsagentes.com/skills/microsoft/azure-skills/microsoft-foundry.md): Despliega, evalúa, ajusta y gestiona agentes de Foundry de punta a punta con azd: agentes hospedados, evaluación por lotes y continua, optimizador de prompts y fine-tuning (SFT/DPO/RFT). - [Azure Prepare](https://skillsagentes.com/skills/microsoft/azure-skills/azure-prepare.md): Prepara proyectos Azure basados en azd para desplegar: genera azure.yaml, la infraestructura (Bicep o Terraform) y los Dockerfiles del flujo del Azure Developer CLI. - [Azure Diagnostics](https://skillsagentes.com/skills/microsoft/azure-skills/azure-diagnostics.md): Depura incidencias de producción en Azure con AppLens, Azure Monitor, resource health y triaje seguro. Cubre App Service, Container Apps, Functions, AKS, VMs y mensajería. - [Azure Validate](https://skillsagentes.com/skills/microsoft/azure-skills/azure-validate.md): Validación previa al despliegue en Azure. Comprueba en profundidad la configuración, la infraestructura (Bicep o Terraform), los roles RBAC, los permisos de identidad administrada y los prerrequisitos. - [Azure App Onboard](https://skillsagentes.com/skills/microsoft/azure-skills/azure-app-onboard.md): Orquestador de punta a punta: de una idea o una app existente hasta un despliegue en Azure, con estimación de costes y aprobación previa. Analiza tu app y detecta los servicios adecuados. ## Skills relacionadas - [Airunway Aks Setup](https://skillsagentes.com/skills/microsoft/azure-skills/airunway-aks-setup.md): Instala AI Runway sobre AKS, de un clúster desnudo a un modelo funcionando: verificación del clúster, instalación del controlador, evaluación de GPU, configuración del proveedor y primer despliegue. - [Azure App Onboard](https://skillsagentes.com/skills/microsoft/azure-skills/azure-app-onboard.md): Orquestador de punta a punta: de una idea o una app existente hasta un despliegue en Azure, con estimación de costes y aprobación previa. Analiza tu app y detecta los servicios adecuados. - [Azure App Onboard Prereq](https://skillsagentes.com/skills/microsoft/azure-skills/azure-app-onboard-prereq.md): Evalúa si tu código está listo para desplegar en Azure, antes del trabajo de infraestructura: salud del build, dependencias, compatibilidad del stack y bloqueantes de despliegue. - [Azure Cloud Migrate](https://skillsagentes.com/skills/microsoft/azure-skills/azure-cloud-migrate.md): Evalúa y migra cargas de trabajo de otras nubes a Azure con informes y conversión de código. Soporta Lambda→Functions, Beanstalk/Heroku/App Engine→App Service y Fargate/Kubernetes/Cloud Run→Container Apps. - [Azure Compute](https://skillsagentes.com/skills/microsoft/azure-skills/azure-compute.md): Router de VMs y VMSS de Azure. Cubre recomendar y comparar tamaños, crear y aprovisionar, reservas de capacidad (CRG) y Essential Machine Management (EMM). --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)