Azure Diagnostics
MicrosoftOfficialCreated by Microsoft
- Skill
- Workflow
- Cloud and DevOps
- MIT
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Azure Diagnostics provides a structured, authoritative approach to investigating and resolving production issues across various Azure services. It emphasizes a systematic flow: identifying symptoms, checking resource health, reviewing logs, analyzing metrics, and investigating recent changes. The skill supports both live troubleshooting via Azure CLI and AppLens, as well as evidence-only analysis when live access is restricted. It includes specialized guidance for App Service, Container Apps, Azure Functions, AKS, VMs, and Messaging services, ensuring consistent root-cause analysis.
What it does
- Provides a standardized diagnostic workflow for Azure production environments.
- Integrates with AppLens and Azure Monitor for automated issue detection and log analysis.
- Offers service-specific troubleshooting paths for App Service, AKS, VMs, and more.
- Supports evidence-only diagnosis for secure, offline troubleshooting scenarios.
- Includes KQL query patterns for deep-dive log and resource health analysis.
- Facilitates the use of bundled diagnostic scripts for efficient data collection.
When to use it
- When investigating production incidents like high CPU, deployment failures, or service crashes.
- When troubleshooting connectivity issues such as RDP/SSH failures or network blocking.
- When diagnosing Kubernetes-specific issues like pod crashloops or image pull failures.
- When analyzing missing telemetry or messaging errors in Event Hubs and Service Bus.
- When performing root-cause analysis on unhealthy or degraded Azure resources.
Advantages
- Reduces mean time to resolution (MTTR) with a clear, step-by-step diagnostic process.
- Ensures consistent troubleshooting practices across different Azure service types.
- Supports secure workflows by allowing diagnosis without requiring live environment access.
- Leverages powerful built-in tools like AppLens and Azure Resource Graph for rapid insights.
- Provides actionable remediation steps based on identified symptoms.
Usage examples
- “Troubleshoot my App Service that is experiencing high CPU usage.”
- The agent will initiate the App Service diagnostic flow, run the appservice-diagnostics script, check metrics, and guide you through profiling via Kudu.
- “Why is my Azure VM unreachable via SSH?”
- The agent will follow the VM connectivity troubleshooting guide, checking NSG rules, firewall status, and VM agent health.
- “Analyze these logs to find why my Container App is failing to pull the image.”
- The agent will perform an evidence-only analysis of the provided logs to identify image pull errors or registry authentication issues.
- “Check the health of my AKS cluster and identify why pods are in a crashloop.”
- The agent will check resource health, query logs for the affected pods, and route to the AKS-specific troubleshooting documentation.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/microsoft/azure-diagnostics/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip azure-diagnostics.zip -d .agents/skills
Documentation by Microsoft
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 recommendationsAzure 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 20References
Files
- ATTRIBUTION.mdAdded by AutoGineer983 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md7.3 KiB
- references/app-service/README.md7.8 KiB
- references/azure-resource-graph.md2.8 KiB
- references/container-apps/README.md3.5 KiB
- references/functions/README.md3.9 KiB
- references/functions/durable.md7.6 KiB
- references/functions/triggers.md8.3 KiB
- references/kql-queries.md1.3 KiB
- scripts/aks-baseline.ps1Script7.4 KiB
- scripts/aks-baseline.shScript7.0 KiB
- scripts/appservice-diagnostics.ps1Script2.7 KiB
- scripts/appservice-diagnostics.shScript3.3 KiB
- scripts/containerapp-diagnostics.ps1Script2.5 KiB
- scripts/containerapp-diagnostics.shScript3.1 KiB
- scripts/pod-evidence.ps1Script6.6 KiB
- scripts/pod-evidence.shScript7.1 KiB
- scripts/run-ig.ps1Script5.6 KiB
- scripts/run-ig.shScript6.5 KiB
- scripts/test-messaging-connectivity.ps1Script6.3 KiB
- scripts/test-messaging-connectivity.shScript6.8 KiB
- troubleshooting/aks/aks-troubleshooting.md9.2 KiB
- troubleshooting/aks/general-diagnostics.md2.0 KiB
- troubleshooting/aks/load-balancer-and-ingress.md3.6 KiB
- troubleshooting/aks/network-policy.md832 B
- troubleshooting/aks/networking.md5.5 KiB
- troubleshooting/aks/node-issues.md4.7 KiB
- troubleshooting/aks/optional-aks-operations.md2.3 KiB
- troubleshooting/aks/pod-failures.md7.6 KiB
- troubleshooting/aks/references/aks-mcp.md2.3 KiB
- troubleshooting/aks/references/command-flows.md4.1 KiB
- troubleshooting/aks/references/inspektor-gadget.md7.6 KiB
- troubleshooting/aks/references/structured-input-modes.md1.5 KiB
- troubleshooting/aks/spot-and-zone-issues.md2.5 KiB
- troubleshooting/aks/upgrade-operations.md2.2 KiB
- troubleshooting/compute/references/cannot-connect-to-vm.md3.1 KiB
- troubleshooting/compute/references/credential-auth-errors.md2.3 KiB
- troubleshooting/compute/references/firewall-blocking.md2.3 KiB
- troubleshooting/compute/references/network-connectivity.md2.5 KiB
- troubleshooting/compute/references/rdp-connectivity.md2.7 KiB
- troubleshooting/compute/references/rdp-service-config.md3.2 KiB
- troubleshooting/compute/references/ssh-connectivity.md2.9 KiB
- troubleshooting/compute/references/vm-agent-not-responding.md3.6 KiB
- troubleshooting/compute/vm-troubleshooting.md3.3 KiB
- troubleshooting/messaging/README.md1.6 KiB
- troubleshooting/messaging/auth-best-practices.md6.1 KiB
- troubleshooting/messaging/azure-eventhubs-dotnet.md3.5 KiB
- troubleshooting/messaging/azure-eventhubs-java.md3.2 KiB
- troubleshooting/messaging/azure-eventhubs-js.md2.7 KiB
- troubleshooting/messaging/azure-eventhubs-py.md4.3 KiB
- troubleshooting/messaging/azure-servicebus-dotnet.md2.5 KiB
- troubleshooting/messaging/azure-servicebus-java.md2.2 KiB
- troubleshooting/messaging/azure-servicebus-js.md2.4 KiB
- troubleshooting/messaging/azure-servicebus-py.md2.3 KiB
- troubleshooting/messaging/service-troubleshooting.md5.1 KiB
scripts/run-ig.sh
#!/usr/bin/env bash
# run-ig.sh
# Runs an Inspektor Gadget (IG) trace on an AKS node via `kubectl debug`.
#
# Handles the mechanical, error-prone assembly of the IG invocation:
# - resolves the target node from a pod (or takes a node directly)
# - injects the pinned IG image + version
# - applies the correct default --timeout for the gadget type
# - adds the k8s namespace/pod/container filters
# - handles the special `tcpdump` gadget (pcap-ng output piped to tcpdump)
#
# The privileged debug pod requires explicit user approval and appropriate RBAC.
# Use --dry-run to print the assembled command without running it.
#
# Usage:
# ./run-ig.sh --gadget <name> (--pod <pod> --ns <namespace> | --node <node>) [options]
#
# Options:
# --gadget <name> Gadget to run, e.g. trace_dns, snapshot_socket, tcpdump (required)
# --pod <pod> Pod name; the node is resolved automatically
# --ns <namespace> Namespace of the pod (required with --pod)
# --node <node> Run directly against a node (node-wide scope)
# --container <name> Scope to a specific container
# --timeout <seconds> Override the gadget-type default timeout
# --filter <arg> Extra IG flag, repeatable (e.g. --filter --max-entries --filter 20)
# --pf "<expr>" tcpdump packet filter (tcpdump gadget only, e.g. "port 80")
# --ig-version <tag> Override the pinned IG image tag (default below)
# --dry-run Print the assembled command; do not execute
#
# Examples:
# ./run-ig.sh --gadget trace_dns --pod web-0 --ns default
# ./run-ig.sh --gadget snapshot_process --node aks-nodepool1-1234
# ./run-ig.sh --gadget tcpdump --pod web-0 --ns default --pf "port 80"
# ./run-ig.sh --gadget traceloop --pod web-0 --ns default --filter --syscall-filters --filter open,connect
# ./run-ig.sh --gadget trace_dns --pod web-0 --ns default --dry-run
set -euo pipefail
# Pinned IG image tag. Bump this line (and run-ig.ps1) to update the IG version.
IG_VERSION="v0.51.0"
IG_IMAGE_REPO="mcr.microsoft.com/oss/v2/inspektor-gadget/ig"
GADGET=""
POD=""
NS=""
NODE=""
CONTAINER=""
TIMEOUT=""
PF=""
DRY_RUN="false"
EXTRA_FILTERS=()
usage() {
# Print the leading comment block (from line 2) as help, stopping at the
# first non-comment line so script code is never echoed.
awk 'NR>1 && /^#/ { sub(/^# ?/, ""); print; next } NR>1 { exit }' "$0"
}
while [[ $# -gt 0 ]]; do
case "$1" in
--gadget) GADGET="${2:?--gadget requires a value}"; shift 2;;
--pod) POD="${2:?--pod requires a value}"; shift 2;;
--ns|--namespace) NS="${2:?--ns requires a value}"; shift 2;;
--node) NODE="${2:?--node requires a value}"; shift 2;;
--container) CONTAINER="${2:?--container requires a value}"; shift 2;;
--timeout) TIMEOUT="${2:?--timeout requires a value}"; shift 2;;
--filter) EXTRA_FILTERS+=("${2:?--filter requires a value}"); shift 2;;
--pf) PF="${2:?--pf requires a value}"; shift 2;;
--ig-version) IG_VERSION="${2:?--ig-version requires a value}"; shift 2;;
--dry-run) DRY_RUN="true"; shift;;
-h|--help) usage; exit 0;;
*) echo "Unknown argument: $1" >&2; usage >&2; exit 2;;
esac
done
if [[ -z "$GADGET" ]]; then
echo "Error: --gadget is required." >&2
exit 2
fi
if [[ -z "$NODE" && -z "$POD" ]]; then
echo "Error: provide either --node <node> or --pod <pod> --ns <namespace>." >&2
exit 2
fi
if [[ -n "$POD" && -z "$NS" ]]; then
echo "Error: --pod requires --ns <namespace>." >&2
exit 2
fi
# Default timeout by gadget type, inferred from the gadget name prefix.
# snapshot_* / top_* -> 5s (point-in-time / quick aggregate)
# trace_* / profile_* / tcpdump -> 30s (streaming / sampling)
default_timeout() {
case "$1" in
snapshot_*|top_*) echo 5;;
trace_*|profile_*|tcpdump) echo 30;;
*) echo 30;; # unknown gadget: use the safer streaming default
esac
}
if [[ -z "$TIMEOUT" ]]; then
TIMEOUT="$(default_timeout "$GADGET")"
fi
# Resolve the node name from the pod when not given directly.
if [[ -z "$NODE" ]]; then
NODE="$(kubectl get pod "$POD" -n "$NS" -o jsonpath='{.spec.nodeName}')"
if [[ -z "$NODE" ]]; then
echo "Error: could not resolve node for pod '$POD' in namespace '$NS'." >&2
exit 1
fi
fi
IG_IMAGE="${IG_IMAGE_REPO}:${IG_VERSION}"
# Assemble the k8s scoping filters.
FILTERS=()
[[ -n "$NS" ]] && FILTERS+=(--k8s-namespace "$NS")
[[ -n "$POD" ]] && FILTERS+=(--k8s-podname "$POD")
[[ -n "$CONTAINER" ]] && FILTERS+=(--k8s-containername "$CONTAINER")
# Base kubectl debug invocation.
DEBUG=(kubectl debug --profile=sysadmin "node/${NODE}" --attach --quiet --image="$IG_IMAGE" --)
if [[ "$GADGET" == "tcpdump" ]]; then
# tcpdump emits raw pcap-ng; pipe through tcpdump for readable output when available.
IG_CMD=(ig run "tcpdump:${IG_VERSION}" -o pcap-ng "${FILTERS[@]}" --timeout "$TIMEOUT")
[[ -n "$PF" ]] && IG_CMD+=(--pf "$PF")
[[ ${#EXTRA_FILTERS[@]} -gt 0 ]] && IG_CMD+=("${EXTRA_FILTERS[@]}")
else
if [[ -n "$PF" ]]; then
echo "Error: --pf is only valid for the tcpdump gadget." >&2
exit 2
fi
IG_CMD=(ig run "${GADGET}:${IG_VERSION}" -o json "${FILTERS[@]}" --timeout "$TIMEOUT")
[[ ${#EXTRA_FILTERS[@]} -gt 0 ]] && IG_CMD+=("${EXTRA_FILTERS[@]}")
fi
FULL_CMD=("${DEBUG[@]}" "${IG_CMD[@]}")
# Pretty-print a shell-quoted version of the command for display.
quote_cmd() {
local out=""
local a
for a in "$@"; do
if [[ "$a" =~ [[:space:]] ]]; then
out+="\"$a\" "
else
out+="$a "
fi
done
echo "${out% }"
}
DISPLAY_CMD="$(quote_cmd "${FULL_CMD[@]}")"
# The tcpdump gadget is only piped through `tcpdump` when that binary is present.
# Reflect the real behavior in the displayed command so --dry-run does not mislead.
TCPDUMP_AVAIL="false"
if [[ "$GADGET" == "tcpdump" ]] && command -v tcpdump >/dev/null 2>&1; then
TCPDUMP_AVAIL="true"
DISPLAY_CMD="$DISPLAY_CMD | tcpdump -nvr -"
fi
echo "Gadget: $GADGET" >&2
echo "Node: $NODE" >&2
echo "Timeout: ${TIMEOUT}s" >&2
echo "Image: $IG_IMAGE" >&2
echo "Command: $DISPLAY_CMD" >&2
if [[ "$GADGET" == "tcpdump" && "$TCPDUMP_AVAIL" == "false" ]]; then
echo "Note: tcpdump not found; emitting raw pcap-ng to stdout." >&2
fi
if [[ "$DRY_RUN" == "true" ]]; then
echo "(dry-run: command not executed)" >&2
exit 0
fi
echo "Ran gadget $GADGET on node $NODE (timeout ${TIMEOUT}s)" >&2
if [[ "$TCPDUMP_AVAIL" == "true" ]]; then
"${FULL_CMD[@]}" | tcpdump -nvr -
else
"${FULL_CMD[@]}"
fi
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs a command-line tool
Security
What our scanner noticed· Low risk
- Instructions that use the network
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Microsoft
- Publisher
- Microsoft (Official)
- Source
- microsoft/skills · .github/plugins/azure-skills/skills/azure-diagnostics · commit 0696600
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from .github/plugins/azure-skills/LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Also distributed in
- microsoft/azure-skills
AutoGineer is not affiliated with or endorsed by Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download azure-diagnostics.zip