All skills
microsoft avatar

/azure-diagnostics

@ae5e585
by microsoftmicrosoft/skills3.1k stars
351

Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, troubleshoot functions, 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, service bus dead letter.

Use this Skill: https://skilld.dev/gh/microsoft/skills/azure-diagnostics

This session only. Nothing lands on disk.

troubleshootingaksnode-issues.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Node & Cluster Troubleshooting

Node NotReady

Diagnostics:

kubectl get nodes -o wide
kubectl describe node <node-name>
# Look for: Conditions, Taints, Events, resource usage, kubelet status

Condition decision tree:

Condition Value Meaning Fix Path
Ready False kubelet stopped reporting SSH to node; if unrecoverable, consider cordon/drain/delete*
MemoryPressure True Node running out of memory Evict pods; scale out pool; reduce pod density
DiskPressure True OS disk or ephemeral storage full Check logs and images; clean up or increase disk
PIDPressure True Too many processes App spawning excessive threads/processes; use IG snapshot_process
NetworkUnavailable True CNI plugin issue Check CNI pods in kube-system; node network config

*Only after explicit user request for remediation and confirmation of workload impact.

AKS-specific - SSH to a node:

⚠️ Warning: kubectl debug node/... creates a privileged debug pod on the node and is not a read-only diagnostic step. Default to read-only evidence gathering first. Only suggest or run this after the user explicitly asks for remediation or approves a privileged diagnostic action and understands the change-control impact.

# Create a privileged debug pod on the node
kubectl debug node/<node-name> -it --image=mcr.microsoft.com/cbl-mariner/base/core:2.0

# Check kubelet status inside the node
chroot /host systemctl status kubelet
chroot /host journalctl -u kubelet -n 50

Optional remediation if kubelet can't recover (after confirmation): cordon -> drain -> delete. AKS auto-replaces via node pool VMSS.

⚠️ Warning: These commands are disruptive. By default, stay in read-only diagnostic mode. Only suggest or run them if the user has explicitly requested remediation and confirmed they understand the workload and PodDisruptionBudget impact.

kubectl cordon <node-name>
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data
kubectl delete node <node-name>

Node Pool Not Scaling

Cluster Autoscaler Not Triggering

Diagnostics:

# Autoscaler logs
kubectl logs -n kube-system -l app=cluster-autoscaler --tail=100

# Autoscaler status
kubectl get configmap cluster-autoscaler-status -n kube-system -o yaml

# Verify autoscaler is enabled on the node pool
az aks nodepool show -g <rg> --cluster-name <cluster> -n <nodepool> \
  --query "{autoscaleEnabled:enableAutoScaling, min:minCount, max:maxCount}"

Autoscaler won't scale up - common reasons:

  • Node pool already at maxCount
  • VM quota exhausted: az vm list-usage -l <region> -o table | grep -i "DSv3\|quota"
  • Pod nodeAffinity is unsatisfiable on any new node template
  • 10-minute cooldown period still active after last scale event

Autoscaler won't scale down - common reasons:

  • Pods with emptyDir local storage (configure --skip-nodes-with-local-storage=false if safe)
  • Standalone pods with no controller (not in a ReplicaSet)
  • cluster-autoscaler.kubernetes.io/safe-to-evict: "false" annotation on a pod

Manual Scaling

az aks nodepool scale -g <rg> --cluster-name <cluster> -n <nodepool> --node-count <n>

Resource Pressure & Capacity Planning

Check actual vs allocatable:

kubectl describe node <node> | grep -A6 "Allocated resources:"

See AKS resource reservations for allocatable math.

Ephemeral storage pressure:

# Check what's consuming ephemeral storage on a node
kubectl debug node/<node> -it --image=mcr.microsoft.com/cbl-mariner/base/core:2.0

Common culprit: high-volume container logs accumulating in /var/log/containers.

Deep diagnostics with Inspektor Gadget (PID pressure or unknown process load):

Use scripts/run-ig.sh --gadget snapshot_process --node <node-name> (or run-ig.ps1) to list all processes on the node. For node-wide scope, use --node (no pod filters). See references/inspektor-gadget.md.


Detailed Node And Cluster Guides

  • Upgrade Operations for node images, Kubernetes version upgrades, surge settings, and PDB-related drain blockers.
  • Spot And Zone Issues for spot evictions, tolerations, zone skew, and zonal storage or service behavior.

Source: SKILL.md on GitHub

1 warning15d4 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    This skill is designed for Azure diagnostics and troubleshooting, providing a comprehensive set of guides and scripts that utilize standard tools like the Azure CLI and kubectl. It includes some security considerations, such as the ingestion of logs which provides a surface for indirect prompt injection, and the use of privileged debug pods for advanced diagnostics. These are used within the skill's intended functionality and are accompanied by appropriate guidance for user approval.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

  • Runlayer7mo

    4/4 files flagged

Signed by skilld at ae5e585. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
metadata
{
  "author": "Microsoft",
  "version": "1.2.6"
}

README badge

README badge for microsoft/skills/azure-diagnostics