agentleFS
jonathan-vellajonathan-vella/apex/.github/skills/apex-azure-diagnostics/SKILL.md

apex-azure-diagnostics

Skill216 starsChanged 2 months agoMITView on GitHub

**WORKFLOW SKILL** — Debug Azure production issues: Container Apps, Functions, App Service, AKS, VMs and messaging, with KQL log analysis. WHEN: 'troubleshoot container apps', 'troubleshoot AKS', 'pod crashloop', 'VM RDP or SSH failure', 'app service high CPU', 'service bus errors'. DO NOT USE FOR: pre-deploy validation (apex-azure-validate), cost (apex-azure-cost-optimization), AKS design (apex-azure-kubernetes).

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Start with systematic diagnosis flow

    line 38
  2. Distinctive:

    Use AppLens (MCP) for AI-powered diagnostics when available

    line 39
  3. Distinctive:

    Check resource health before deep-diving into logs

    line 40
  4. Distinctive:

    Document findings and attempted remediation steps

    line 42
  5. Very specific:

    Default to read-only. Restarts, redeploys, run-command, credential resets, NSG changes, cordon/drain and node debug pods (run-ig with …

    line 44
  6. Distinctive:

    Never print secret values: list app setting names only, and never pass passwords through chat

    line 46
  7. Distinctive:

    Use available Azure CLI or MCP capabilities.

    line 51
  8. Distinctive:

    Follow the diagnostic workflow for discovery, health/metrics, logs, recent changes, severity classification and reporting.

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
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 Azure Function Apps (invocation failures, timeouts, binding errors)
  • Find the App Insights or Log Analytics workspace linked to a Function App
  • Troubleshoot App Service issues (high CPU, deployment failures, crashes, slow responses, TLS/custom domains)
  • Troubleshoot AKS clusters, nodes, pods, ingress, DNS or upgrades
  • Troubleshoot Azure VM connectivity (RDP/SSH failures, NSG or firewall blocks, VM agent issues)
  • Troubleshoot Event Hubs and Service Bus SDK errors (AMQP failures, lock lost, connectivity)

Rules

  1. Start with systematic diagnosis flow
  2. Use AppLens (MCP) for AI-powered diagnostics when available
  3. Check resource health before deep-diving into logs
  4. Select appropriate troubleshooting guide based on service type
  5. Document findings and attempted remediation steps
  6. Diagnose only the approved scope; obtain separate approval before remediation
  7. Default to read-only. Restarts, redeploys, run-command, credential resets, NSG changes, cordon/drain and node debug pods (run-ig with --approve) each need explicit approval
  8. Never print secret values: list app setting names only, and never pass passwords through chat

Prerequisites

  • Confirm resource IDs, subscription, incident window and read access.
  • Use available Azure CLI or MCP capabilities; unavailable telemetry is a gap, not a healthy result. Do not dump credentials or app settings into reports.

Steps

Follow the diagnostic workflow for discovery, health/metrics, logs, recent changes, severity classification and reporting. That procedure owns phase order and the severity-to-priority mapping. Load only the health checks and query templates needed for the selected service.


Troubleshooting Guides by Service

ServiceCommon IssuesReference
Container AppsImage pull failures, cold starts, health probes, port mismatchescontainer-apps/
App ServiceHigh CPU, deployment failures, crashes, slow responses, TLS/custom domainsapp-service/
Function AppsApp details, invocation failures, timeouts, binding errors, cold starts, missing app settingsfunctions/
AKSCluster access, nodes, kube-system, scheduling, crash loops, ingress, DNS, upgradesAKS troubleshooting
Compute (VM)RDP/SSH connectivity, NSG/firewall blocks, credential resets, VM agent issuesVM connectivity
MessagingEvent Hubs and Service Bus SDK errors, AMQP failures, message lock, connectivityMessaging troubleshooting

Route active AKS incidents, VM connectivity and messaging SDK problems to their guides above; keep Container Apps, App Service and Function Apps diagnostics in this skill.

Scripts

Bash and PowerShell pairs in scripts/ gather evidence in one pass. All are read-only except run-ig.

ScriptPurpose
aks-baselineAKS provisioning state, node pools, recent activity, node readiness and kube-system health
pod-evidenceStatus, describe, current and previous logs, and resource usage for unhealthy pods
run-igInspektor Gadget trace through a privileged node debug pod; runs only with --approve/-Approve
appservice-diagnosticsApp Service config, recent deployments, app setting names and custom domains
containerapp-diagnosticsContainer App revisions, registry and ingress config, and recent logs
test-messaging-connectivityDNS, HTTPS and AMQP/Kafka port reachability for a Service Bus or Event Hubs namespace

Quick Reference

Common Diagnostic Commands

# Inspect resource metadata (not Resource Health availability)
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>"

Metadata/provisioning state from az resource show is not Resource Health availability. If the Resource Health tool is unavailable, report that check as unavailable and continue the approved health checks.


Reference Index

  • KQL Query Library
  • Azure Resource Graph Queries
  • InfraOps KQL Templates — custom Azure Resource Graph and Log Analytics queries
  • InfraOps Health Checks — per-resource-type diagnostic commands
  • InfraOps Remediation Playbooks — 6-phase diagnostic workflow
  • Function Apps Troubleshooting
  • App Service Troubleshooting
  • AKS Troubleshooting — intake, evidence, per-symptom guides and Inspektor Gadget
  • VM Connectivity Troubleshooting — RDP/SSH, NSG/firewall, credentials, VM agent
  • Messaging Troubleshooting — Event Hubs and Service Bus SDK guides

Load these references on demand, not all at once.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.