azure-diagnostics
Debug Azure production issues using AppLens, Azure Monitor, resource health, and safe triage, including evidence-only diagnosis without live access. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 1.6k
- Forks
- 267
01 前言 Front Matter
- name
- azure-diagnostics
- license
- MIT
- metadata
- { "author": "Microsoft", "version": "1.2.14" }
- description
- Debug Azure production issues using AppLens, Azure Monitor, resource health, and safe triage, including evidence-only diagnosis without live access. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
02 资源文件 53
- 参考文档references/app-service/README.md7.8 KB
- 参考文档references/azure-resource-graph.md2.8 KB
- 参考文档references/container-apps/README.md3.5 KB
- 参考文档references/functions/durable.md7.6 KB
- 参考文档references/functions/README.md3.9 KB
- 参考文档references/functions/triggers.md8.3 KB
- 参考文档references/kql-queries.md1.3 KB
- 脚本scripts/aks-baseline.ps17.4 KB
- 脚本scripts/aks-baseline.sh7.0 KB
- 脚本scripts/appservice-diagnostics.ps12.7 KB
- 脚本scripts/appservice-diagnostics.sh3.3 KB
- 脚本scripts/containerapp-diagnostics.ps12.5 KB
- 脚本scripts/containerapp-diagnostics.sh3.1 KB
- 脚本scripts/pod-evidence.ps16.6 KB
- 脚本scripts/pod-evidence.sh7.1 KB
- 脚本scripts/run-ig.ps15.6 KB
- 脚本scripts/run-ig.sh6.5 KB
- 脚本scripts/test-messaging-connectivity.ps16.3 KB
- 脚本scripts/test-messaging-connectivity.sh6.8 KB
- 参考文档troubleshooting/aks/aks-troubleshooting.md9.2 KB
- 参考文档troubleshooting/aks/general-diagnostics.md2.0 KB
- 参考文档troubleshooting/aks/load-balancer-and-ingress.md3.6 KB
- 参考文档troubleshooting/aks/network-policy.md832 B
- 参考文档troubleshooting/aks/networking.md5.5 KB
- 参考文档troubleshooting/aks/node-issues.md4.7 KB
- 参考文档troubleshooting/aks/optional-aks-operations.md2.3 KB
- 参考文档troubleshooting/aks/pod-failures.md7.6 KB
- 参考文档troubleshooting/aks/references/aks-mcp.md2.3 KB
- 参考文档troubleshooting/aks/references/command-flows.md4.1 KB
- 参考文档troubleshooting/aks/references/inspektor-gadget.md7.6 KB
- 参考文档troubleshooting/aks/references/structured-input-modes.md1.5 KB
- 参考文档troubleshooting/aks/spot-and-zone-issues.md2.5 KB
- 参考文档troubleshooting/aks/upgrade-operations.md2.2 KB
- 参考文档troubleshooting/compute/references/cannot-connect-to-vm.md3.1 KB
- 参考文档troubleshooting/compute/references/credential-auth-errors.md2.3 KB
- 参考文档troubleshooting/compute/references/firewall-blocking.md2.3 KB
- 参考文档troubleshooting/compute/references/network-connectivity.md2.5 KB
- 参考文档troubleshooting/compute/references/rdp-connectivity.md2.7 KB
- 参考文档troubleshooting/compute/references/rdp-service-config.md3.2 KB
- 参考文档troubleshooting/compute/references/ssh-connectivity.md2.9 KB
- 参考文档troubleshooting/compute/references/vm-agent-not-responding.md3.6 KB
- 参考文档troubleshooting/compute/vm-troubleshooting.md3.3 KB
- 参考文档troubleshooting/messaging/auth-best-practices.md6.1 KB
- 参考文档troubleshooting/messaging/azure-eventhubs-dotnet.md3.5 KB
- 参考文档troubleshooting/messaging/azure-eventhubs-java.md3.2 KB
- 参考文档troubleshooting/messaging/azure-eventhubs-js.md2.7 KB
- 参考文档troubleshooting/messaging/azure-eventhubs-py.md4.3 KB
- 参考文档troubleshooting/messaging/azure-servicebus-dotnet.md2.5 KB
- 参考文档troubleshooting/messaging/azure-servicebus-java.md2.2 KB
- 参考文档troubleshooting/messaging/azure-servicebus-js.md2.4 KB
- 参考文档troubleshooting/messaging/azure-servicebus-py.md2.3 KB
- 参考文档troubleshooting/messaging/README.md1.6 KB
- 参考文档troubleshooting/messaging/service-troubleshooting.md5.1 KB
03 SKILL.md 正文
Azure Diagnostics
AUTHORITATIVE GUIDANCE — MANDATORY COMPLIANCE
This document is the official source for debugging and troubleshooting Azure production issues. Follow these instructions to diagnose and resolve common Azure service problems systematically.
Triggers
Activate this skill when user wants to:
- Debug or troubleshoot production issues
- Diagnose errors in Azure services
- Analyze application logs or metrics
- Fix image pull, cold start, or health probe issues
- Investigate why Azure resources are failing
- Find root cause of application errors
- Troubleshoot App Service issues (high CPU, deployment failures, crashes, slow responses, TLS/custom domains)
- Respond to prompts like "troubleshoot app service", "app service high CPU", or "app service deployment failure"
- Troubleshoot Azure Function Apps (invocation failures, timeouts, binding errors)
- Find the App Insights or Log Analytics workspace linked to a Function App
- Troubleshoot AKS clusters, nodes, pods, ingress, or Kubernetes networking issues
- Troubleshoot Azure VM connectivity issues (RDP/SSH failures, port 3389/22 timeouts, NSG or firewall blocking, credential resets)
- Troubleshoot Azure Messaging SDK issues (Event Hubs, Service Bus connection failures, AMQP errors, message lock issues)
- Root-cause a symptom that looks like a healthy-runtime-but-wrong-destination problem (e.g., telemetry/messages stop flowing to the expected resource after a config change) — invoke this skill for the matrix even when MCP tools could answer the surface question alone
Rules
- Start with systematic diagnosis flow
- Use supplied evidence first. If the user requests evidence-only analysis or prohibits live Azure access, do not query or modify Azure. Diagnose from the supplied logs, metrics, and timeline; identify assumptions and provide optional verification steps.
- Use AppLens (MCP) for AI-powered diagnostics when available
- Check resource health before deep-diving into logs
- Select appropriate troubleshooting guide based on service type
- Document findings and attempted remediation steps
- Prefer bundled diagnostic scripts over ad hoc calls for permitted live collection when identifiers are known. If supplied evidence suffices or live access is prohibited, don't run them; otherwise run the applicable script first.
- Route AKS incidents to the dedicated AKS troubleshooting document
- Keep baseline AKS diagnostics available even when the optional
aks-skillsadd-on is absent, declined, or unsupported by the host
Quick Diagnosis Flow
- Identify symptoms - What's failing?
- Check resource health - Is Azure healthy?
- Review logs - What do logs show?
- Analyze metrics - Performance patterns?
- Investigate recent changes - What changed?
Troubleshooting Guides by Service
| Service | Common Issues | Reference |
|---|---|---|
| Container Apps | Image pull failures, cold starts, health probes, port mismatches | container-apps/ |
| App Service | High CPU, deployment failures, crashes, slow responses, TLS/custom domains | app-service/ |
| Function Apps | App details, invocation failures, timeouts, binding errors, cold starts, missing app settings | functions/ |
| AKS | Cluster access, nodes, kube-system, scheduling, crash loops, ingress, DNS, upgrades |
AKS Troubleshooting |
| Compute | VM RDP/SSH connectivity, NSG/firewall blocks, credential resets, VM agent/tooling issues | VM Connectivity Troubleshooting |
| Messaging | Event Hubs & Service Bus SDK errors, AMQP failures, message lock, connectivity | Messaging Troubleshooting |
Routing
- Keep Container Apps and Function Apps diagnostics in this parent skill.
- Route active AKS incidents, AKS-specific intake, evidence gathering, and remediation guidance to AKS Troubleshooting.
- Route Azure VM RDP/SSH connectivity, NSG/firewall, credential reset, and VM agent troubleshooting to VM Connectivity Troubleshooting.
- Route Azure Messaging SDK troubleshooting (Event Hubs, Service Bus) to Messaging Troubleshooting.
Quick Reference
Common Diagnostic Commands
# Check resource health
az resource show --ids RESOURCE_ID
# View activity log
az monitor activity-log list -g RG --max-events 20
# Container Apps logs
az containerapp logs show --name APP -g RG --follow
# Function App logs (query App Insights traces)
az monitor app-insights query --apps APP-INSIGHTS -g RG \
--analytics-query "traces | where timestamp > ago(1h) | order by timestamp desc | take 50"
AppLens (MCP Tools)
For AI-powered diagnostics, use:
mcp_azure_mcp_applens
intent: "diagnose issues with <resource-name>"
command: "diagnose"
parameters:
resourceId: "<resource-id>"
Provides:
- Automated issue detection
- Root cause analysis
- Remediation recommendations
Azure Monitor (MCP Tools)
For querying logs and metrics:
mcp_azure_mcp_monitor
intent: "query logs for <resource-name>"
command: "logs_query"
parameters:
workspaceId: "<workspace-id>"
query: "<KQL-query>"
See kql-queries.md for common diagnostic queries.
Check Azure Resource Health
Using MCP
mcp_azure_mcp_resourcehealth
intent: "check health status of <resource-name>"
command: "get"
parameters:
resourceId: "<resource-id>"
Using CLI
# Check specific resource health
az resource show --ids RESOURCE_ID
# Check recent activity
az monitor activity-log list -g RG --max-events 20
References
04 同仓库更多 Skills
python-appservice-deploy
Deploy Python (Flask/Django/FastAPI) code to Azure App Service Linux. WHEN: "Flask App Service", "Django App Service", "FastAPI App Service", "deploy Python to App Service". DO NOT USE FOR: Container Apps, Functions, non-Python, Terraform/Bicep/IaC, full infra — use azure-prepare.
preset
Intelligently deploys Azure OpenAI models to optimal regions by analyzing capacity across all available regions. Automatically checks current region first and shows alternatives if needed. USE FOR: quick deployment, optimal region, best region, automatic region selection, fast setup, multi-region capacity check, high availability deployment, deploy to best location. DO NOT USE FOR: custom SKU selection (use customize), specific version selection (use customize), custom capacity configuration (use customize), PTU deployments (use customize).
customize
Interactive guided deployment flow for Azure OpenAI models with full customization control. Step-by-step selection of model version, SKU (GlobalStandard/Standard/ProvisionedManaged), capacity, RAI policy (content filter), and advanced options (dynamic quota, priority processing, spillover). USE FOR: custom deployment, customize model deployment, choose version, select SKU, set capacity, configure content filter, RAI policy, deployment options, detailed deployment, advanced deployment, PTU deployment, provisioned throughput. DO NOT USE FOR: quick deployment to optimal region (use preset).
capacity
Discovers available Azure OpenAI model capacity across regions and projects. Analyzes quota limits, compares availability, and recommends optimal deployment locations based on capacity requirements. USE FOR: find capacity, check quota, where can I deploy, capacity discovery, best region for capacity, multi-project capacity search, quota analysis, model availability, region comparison, check TPM availability. DO NOT USE FOR: actual deployment (hand off to preset or customize after discovery), quota increase requests (direct user to Azure Portal), listing existing deployments.
deploy-model
Unified Azure OpenAI model deployment skill with intelligent intent-based routing. Handles quick preset deployments, fully customized deployments (version/SKU/capacity/RAI policy), and capacity discovery across regions and projects. USE FOR: deploy model, deploy gpt, create deployment, model deployment, deploy openai model, set up model, provision model, find capacity, check model availability, where can I deploy, best region for model, capacity analysis. DO NOT USE FOR: listing existing deployments (use foundry_models_deployments_list MCP tool), deleting deployments, agent creation (use agent/create), project creation (use project/create).
finetuning
Fine-tune models on Microsoft Foundry using SFT (supervised), DPO (preference), or RFT (reinforcement with graders). Covers dataset preparation, training job submission, deployment, and evaluation. USE FOR: fine-tune, SFT, DPO, RFT, training data, grader, distillation, fine-tuned model, training job, large file upload, calibrate grader, deploy fine-tuned model, evaluate fine-tuned model. DO NOT USE FOR: general model deployment without fine-tuning (use deploy-model), agent creation (use agents), prompt optimization without training (use prompt-optimizer).