appinsights-instrumentation

bởi microsoft

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.

npx skills add https://github.com/microsoft/azure-skills --skill appinsights-instrumentation

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

Platform-Specific Guides

Thêm skills từ microsoft

oss-growth
microsoft
Cá tính tăng trưởng OSS
official
microsoft-foundry
microsoft
Triển khai, đánh giá và quản lý các agent Foundry từ đầu đến cuối: xây dựng Docker, đẩy lên ACR, tạo agent lưu trữ/agent nhắc nhở, khởi động container, đánh giá hàng loạt, đánh giá liên tục, quy trình tối ưu hóa nhắc nhở, agent.yaml, quản lý bộ dữ liệu từ dấu vết. SỬ DỤNG CHO: triển khai agent lên Foundry, agent lưu trữ, tạo agent, gọi agent, đánh giá agent, chạy đánh giá hàng loạt, đánh giá liên tục, giám sát liên tục, trạng thái đánh giá liên tục, tối ưu hóa nhắc nhở, cải thiện nhắc nhở, trình tối
officialdevelopmentdevops
azure-ai
microsoft
Sử dụng cho Azure AI: Tìm kiếm, Giọng nói, OpenAI, Xử lý tài liệu. Hỗ trợ tìm kiếm, tìm kiếm vector/kết hợp, chuyển giọng nói thành văn bản, chuyển văn bản thành giọng nói, phiên âm, OCR. KHI: AI Search, truy vấn tìm kiếm, tìm kiếm vector, tìm kiếm kết hợp, tìm kiếm ngữ nghĩa, chuyển giọng nói thành văn bản, chuyển văn bản thành giọng nói, phiên âm, OCR, chuyển đổi văn bản thành giọng nói.
officialdevelopmentapi
azure-deploy
microsoft
Thực thi triển khai Azure cho các ứng dụng ĐÃ ĐƯỢC CHUẨN BỊ có sẵn tệp .azure/deployment-plan.md và tệp cơ sở hạ tầng. KHÔNG sử dụng kỹ năng này khi người dùng yêu cầu TẠO ứng dụng mới — hãy sử dụng azure-prepare thay thế. Kỹ năng này chạy các lệnh azd up, azd deploy, terraform apply và az deployment với khả năng phục hồi lỗi tích hợp. Yêu cầu .azure/deployment-plan.md từ azure-prepare và trạng thái đã xác thực từ azure-validate. KHI: "chạy azd up", "chạy azd deploy", "thực thi triển khai",...
officialdevopsaws
azure-storage
microsoft
Dịch vụ Lưu trữ Azure bao gồm Blob Storage, File Shares, Queue Storage, Table Storage và Data Lake. Trả lời các câu hỏi về các tầng truy cập lưu trữ (hot, cool, cold, archive), thời điểm sử dụng từng tầng và so sánh các tầng. Cung cấp lưu trữ đối tượng, chia sẻ tệp SMB, nhắn tin không đồng bộ, NoSQL key-value và phân tích dữ liệu lớn. Bao gồm quản lý vòng đời. SỬ DỤNG CHO: blob storage, file shares, queue storage, table storage, data lake, tải lên tệp, tải xuống blob, tài khoản lưu trữ, các tầng truy cập,...
officialdevelopmentdatabase
azure-diagnostics
microsoft
Gỡ lỗi các vấn đề sản xuất trên Azure bằng AppLens, Azure Monitor, tình trạng tài nguyên và phân loại an toàn. KHI: gỡ lỗi vấn đề sản xuất, khắc phục sự cố app service, app service CPU cao, lỗi triển khai app service, khắc phục sự cố container apps, khắc phục sự cố functions, khắc phục sự cố AKS, kubectl không kết nối được, lỗi kube-system/CoreDNS, pod đang chờ, crashloop, node chưa sẵn sàng, lỗi nâng cấp, phân tích nhật ký, KQL, thông tin chi tiết, lỗi kéo image, vấn đề khởi động nguội, lỗi health probe,...
officialdevopsdevelopment
azure-prepare
microsoft
Chuẩn bị ứng dụng Azure để triển khai (hạ tầng Bicep/Terraform, azure.yaml, Dockerfiles). Sử dụng để tạo/hiện đại hóa hoặc tạo+triển khai; không dùng cho di chuyển đa đám mây (sử dụng azure-cloud-migrate). KHÔNG DÙNG CHO: ứng dụng copilot-sdk (sử dụng azure-hosted-copilot-sdk). KHI: "tạo ứng dụng", "xây dựng ứng dụng web", "tạo API", "tạo HTTP API serverless", "tạo frontend", "tạo backend", "xây dựng dịch vụ", "hiện đại hóa ứng dụng", "cập nhật ứng dụng", "thêm xác thực", "thêm bộ nhớ đệm", "lưu trữ trên Azure", "tạo và...
officialdevelopmentdevops
azure-validate
microsoft
Kiểm tra trước khi triển khai để đảm bảo sẵn sàng trên Azure. Chạy kiểm tra sâu về cấu hình, hạ tầng (Bicep hoặc Terraform), phân công vai trò RBAC, quyền của managed identity và các điều kiện tiên quyết trước khi triển khai. KHI NÀO: xác thực ứng dụng của tôi, kiểm tra mức độ sẵn sàng triển khai, chạy kiểm tra trước khi triển khai, xác minh cấu hình, kiểm tra xem đã sẵn sàng triển khai chưa, xác thực azure.yaml, xác thực Bicep, kiểm tra trước khi triển khai, khắc phục lỗi triển khai, xác thực Azure Functions, xác thực function app, xác th
officialdevopstesting