$npx -y skills add github/awesome-copilot --skill azure-resource-health-diagnoseAnalyze Azure resource health, diagnose issues from logs and telemetry, and create a remediation plan for identified problems.
| 1 | # Azure Resource Health & Issue Diagnosis |
| 2 | |
| 3 | This workflow analyzes a specific Azure resource to assess its health status, diagnose potential issues using logs and telemetry data, and develop a comprehensive remediation plan for any problems discovered. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | - Azure MCP server configured and authenticated |
| 7 | - Target Azure resource identified (name and optionally resource group/subscription) |
| 8 | - Resource must be deployed and running to generate logs/telemetry |
| 9 | - Prefer Azure MCP tools (`azmcp-*`) over direct Azure CLI when available |
| 10 | |
| 11 | ## Workflow Steps |
| 12 | |
| 13 | ### Step 1: Get Azure Best Practices |
| 14 | **Action**: Retrieve diagnostic and troubleshooting best practices |
| 15 | **Tools**: Azure MCP best practices tool |
| 16 | **Process**: |
| 17 | 1. **Load Best Practices**: |
| 18 | - Execute Azure best practices tool to get diagnostic guidelines |
| 19 | - Focus on health monitoring, log analysis, and issue resolution patterns |
| 20 | - Use these practices to inform diagnostic approach and remediation recommendations |
| 21 | |
| 22 | ### Step 2: Resource Discovery & Identification |
| 23 | **Action**: Locate and identify the target Azure resource |
| 24 | **Tools**: Azure MCP tools + Azure CLI fallback |
| 25 | **Process**: |
| 26 | 1. **Resource Lookup**: |
| 27 | - If only resource name provided: Search across subscriptions using `azmcp-subscription-list` |
| 28 | - Use `az resource list --name <resource-name>` to find matching resources |
| 29 | - If multiple matches found, prompt user to specify subscription/resource group |
| 30 | - Gather detailed resource information: |
| 31 | - Resource type and current status |
| 32 | - Location, tags, and configuration |
| 33 | - Associated services and dependencies |
| 34 | |
| 35 | 2. **Resource Type Detection**: |
| 36 | - Identify resource type to determine appropriate diagnostic approach: |
| 37 | - **Web Apps/Function Apps**: Application logs, performance metrics, dependency tracking |
| 38 | - **Virtual Machines**: System logs, performance counters, boot diagnostics |
| 39 | - **Cosmos DB**: Request metrics, throttling, partition statistics |
| 40 | - **Storage Accounts**: Access logs, performance metrics, availability |
| 41 | - **SQL Database**: Query performance, connection logs, resource utilization |
| 42 | - **Application Insights**: Application telemetry, exceptions, dependencies |
| 43 | - **Key Vault**: Access logs, certificate status, secret usage |
| 44 | - **Service Bus**: Message metrics, dead letter queues, throughput |
| 45 | |
| 46 | ### Step 3: Health Status Assessment |
| 47 | **Action**: Evaluate current resource health and availability |
| 48 | **Tools**: Azure MCP monitoring tools + Azure CLI |
| 49 | **Process**: |
| 50 | 1. **Basic Health Check**: |
| 51 | - Check resource provisioning state and operational status |
| 52 | - Verify service availability and responsiveness |
| 53 | - Review recent deployment or configuration changes |
| 54 | - Assess current resource utilization (CPU, memory, storage, etc.) |
| 55 | |
| 56 | 2. **Service-Specific Health Indicators**: |
| 57 | - **Web Apps**: HTTP response codes, response times, uptime |
| 58 | - **Databases**: Connection success rate, query performance, deadlocks |
| 59 | - **Storage**: Availability percentage, request success rate, latency |
| 60 | - **VMs**: Boot diagnostics, guest OS metrics, network connectivity |
| 61 | - **Functions**: Execution success rate, duration, error frequency |
| 62 | |
| 63 | ### Step 4: Log & Telemetry Analysis |
| 64 | **Action**: Analyze logs and telemetry to identify issues and patterns |
| 65 | **Tools**: Azure MCP monitoring tools for Log Analytics queries |
| 66 | **Process**: |
| 67 | 1. **Find Monitoring Sources**: |
| 68 | - Use `azmcp-monitor-workspace-list` to identify Log Analytics workspaces |
| 69 | - Locate Application Insights instances associated with the resource |
| 70 | - Identify relevant log tables using `azmcp-monitor-table-list` |
| 71 | |
| 72 | 2. **Execute Diagnostic Queries**: |
| 73 | Use `azmcp-monitor-log-query` with targeted KQL queries based on resource type: |
| 74 | |
| 75 | **General Error Analysis**: |
| 76 | ```kql |
| 77 | // Recent errors and exceptions |
| 78 | union isfuzzy=true |
| 79 | AzureDiagnostics, |
| 80 | AppServiceHTTPLogs, |
| 81 | AppServiceAppLogs, |
| 82 | AzureActivity |
| 83 | | where TimeGenerated > ago(24h) |
| 84 | | where Level == "Error" or ResultType != "Success" |
| 85 | | summarize ErrorCount=count() by Resource, ResultType, bin(TimeGenerated, 1h) |
| 86 | | order by TimeGenerated desc |
| 87 | ``` |
| 88 | |
| 89 | **Performance Analysis**: |
| 90 | ```kql |
| 91 | // Performance degradation patterns |
| 92 | Perf |
| 93 | | where TimeGenerated > ago(7d) |
| 94 | | where ObjectName == "Processor" and CounterName == "% Processor Time" |
| 95 | | summarize avg(CounterValue) by Computer, bin(TimeGenerated, 1h) |
| 96 | | where avg_CounterValue > 80 |
| 97 | ``` |
| 98 | |
| 99 | **Application-Specific Queries**: |
| 100 | ```kql |
| 101 | // Application Insights - Failed requests |
| 102 | requests |
| 103 | | where timestamp > ago(24h) |
| 104 | | where success == false |
| 105 | | summarize FailureCount=count() by resultCode, bin(timestamp, 1h) |
| 106 | | order by timestamp desc |
| 107 | |
| 108 | // Database - Connection failures |
| 109 | AzureDiagnostics |
| 110 | | where ResourceProvider == "MICROSOFT.SQL" |
| 111 | | where C |