Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Diagnose Azure service issues, query logs, and troubleshoot failures using GitHub Copilot for Azure
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
troubleshooting/aks/general-diagnostics.md
1# General AKS Investigation & Diagnostics23## "What happened in my cluster?"45When a user asks a broad question like "what happened in my AKS cluster?" or "check my AKS status", follow this systematic flow:671. Cluster health82. Recent events93. Node status104. Unhealthy pods115. All pods overview126. System pods health137. Activity log1415```bash16az aks show -g <rg> -n <cluster> --query "provisioningState"17kubectl get events -A --sort-by='.lastTimestamp' | head -4018kubectl get nodes -o wide19kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded20kubectl get pods -A -o wide21kubectl get pods -n kube-system -o wide22az monitor activity-log list -g <rg> --max-events 20 -o table23```2425---2627## AKS CLI Tools2829```bash30# Get cluster credentials (required before kubectl commands)31az aks get-credentials -g <rg> -n <cluster>3233# View node pools34az aks nodepool list -g <rg> --cluster-name <cluster> -o table35```3637### AppLens (MCP) for AKS3839For AI-powered diagnostics:4041```text42mcp_azure_mcp_applens43intent: "diagnose AKS cluster issues"44command: "diagnose"45parameters:46resourceId: "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.ContainerService/managedClusters/<cluster>"47```4849> 💡 **Tip:** AppLens automatically detects common issues and provides remediation recommendations using the cluster resource ID.5051---5253## Best Practices54551. **Start with kubectl get/describe** - Always check basic status first562. **Check events** - `kubectl get events -A` reveals recent issues573. **Use systematic isolation** - Pod -> Node -> Cluster -> Network584. **Document changes** - Note what you tried and what worked595. **Escalate when needed** - For control plane issues, contact Azure support60