Azure Resource Health & Issue Diagnosis
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.
Prerequisites
- Azure MCP server configured and authenticated
- Target Azure resource identified (name and optionally resource group/subscription)
- Resource must be deployed and running to generate logs/telemetry
- Prefer Azure MCP tools (
azmcp-*) over direct Azure CLI when available
Workflow Steps
Step 1: Get Azure Best Practices
Action: Retrieve diagnostic and troubleshooting best practices
Tools: Azure MCP best practices tool
Process:
- Load Best Practices:
- Execute Azure best practices tool to get diagnostic guidelines
- Focus on health monitoring, log analysis, and issue resolution patterns
- Use these practices to inform diagnostic approach and remediation recommendations
Step 2: Resource Discovery & Identification
Action: Locate and identify the target Azure resource
Tools: Azure MCP tools + Azure CLI fallback
Process:
Resource Lookup:
- If only resource name provided: Search across subscriptions using
azmcp-subscription-list
- Use
az resource list --name <resource-name> to find matching resources
- If multiple matches found, prompt user to specify subscription/resource group
- Gather detailed resource information:
- Resource type and current status
- Location, tags, and configuration
- Associated services and dependencies
Resource Type Detection:
- Identify resource type to determine appropriate diagnostic approach:
- Web Apps/Function Apps: Application logs, performance metrics, dependency tracking
- Virtual Machines: System logs, performance counters, boot diagnostics
- Cosmos DB: Request metrics, throttling, partition statistics
- Storage Accounts: Access logs, performance metrics, availability
- SQL Database: Query performance, connection logs, resource utilization
- Application Insights: Application telemetry, exceptions, dependencies
- Key Vault: Access logs, certificate status, secret usage
- Service Bus: Message metrics, dead letter queues, throughput
Step 3: Health Status Assessment
Action: Evaluate current resource health and availability
Tools: Azure MCP monitoring tools + Azure CLI
Process:
Basic Health Check:
- Check resource provisioning state and operational status
- Verify service availability and responsiveness
- Review recent deployment or configuration changes
- Assess current resource utilization (CPU, memory, storage, etc.)
Service-Specific Health Indicators:
- Web Apps: HTTP response codes, response times, uptime
- Databases: Connection success rate, query performance, deadlocks
- Storage: Availability percentage, request success rate, latency
- VMs: Boot diagnostics, guest OS metrics, network connectivity
- Functions: Execution success rate, duration, error frequency
Step 4: Log & Telemetry Analysis
Action: Analyze logs and telemetry to identify issues and patterns
Tools: Azure MCP monitoring tools for Log Analytics queries
Process:
Find Monitoring Sources:
- Use
azmcp-monitor-workspace-list to identify Log Analytics workspaces
- Locate Application Insights instances associated with the resource
- Identify relevant log tables using
azmcp-monitor-table-list
Execute Diagnostic Queries:
Use azmcp-monitor-log-query with targeted KQL queries based on resource type:
General Error Analysis:
// Recent errors and exceptions
union isfuzzy=true
AzureDiagnostics,
AppServiceHTTPLogs,
AppServiceAppLogs,
AzureActivity
| where TimeGenerated > ago(24h)
| where Level == "Error" or ResultType != "Success"
| summarize ErrorCount=count() by Resource, ResultType, bin(TimeGenerated, 1h)
| order by TimeGenerated desc
Performance Analysis:
// Performance degradation patterns
Perf
| where TimeGenerated > ago(7d)
| where ObjectName == "Processor" and CounterName == "% Processor Time"
| summarize avg(CounterValue) by Computer, bin(TimeGenerated, 1h)
| where avg_CounterValue > 80
Application-Specific Queries:
// Application Insights - Failed requests
requests
| where timestamp > ago(24h)
| where success == false
| summarize FailureCount=count() by resultCode, bin(timestamp, 1h)
| order by timestamp desc
// Database - Connection failures
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.SQL"
| where Category == "SQLSecurityAuditEvents"
| where action_name_s == "CONNECTION_FAILED"
| summarize ConnectionFailures=count() by bin(TimeGenerated, 1h)
Pattern Recognition:
- Identify recurring error patterns or anomalies
- Correlate errors with deployment times or configuration changes
- Analyze performance trends and degradation patterns
- Look for dependency failures or external service issues
Step 5: Issue Classification & Root Cause Analysis
Action: Categorize identified issues and determine root causes
Process:
Issue Classification:
- Critical: Service unavailable, data loss, security breaches
- High: Performance degradation, intermittent failures, high error rates
- Medium: Warnings, suboptimal configuration, minor performance issues
- Low: Informational alerts, optimization opportunities
Root Cause Analysis:
- Configuration Issues: Incorrect settings, missing dependencies
- Resource Constraints: CPU/memory/disk limitations, throttling
- Network Issues: Connectivity problems, DNS resolution, firewall rules
- Application Issues: Code bugs, memory leaks, inefficient queries
- External Dependencies: Third-party service failures, API limits
- Security Issues: Authentication failures, certificate expiration
Impact Assessment:
- Determine business impact and affected users/systems
- Evaluate data integrity and security implications
- Assess recovery time objectives and priorities
Step 6: Generate Remediation Plan
Action: Create a comprehensive plan to address identified issues
Process:
Immediate Actions (Critical issues):
- Emergency fixes to restore service availability
- Temporary workarounds to mitigate impact
- Escalation procedures for complex issues
Short-term Fixes (High/Medium issues):
- Configuration adjustments and resource scaling
- Application updates and patches
- Monitoring and alerting improvements
Long-term Improvements (All issues):
- Architectural changes for better resilience
- Preventive measures and monitoring enhancements
- Documentation and process improvements
Implementation Steps:
- Prioritized action items with specific Azure CLI commands
- Testing and validation procedures
- Rollback plans for each change
- Monitoring to verify issue resolution
Step 7: User Confirmation & Report Generation
Action: Present findings and get approval for remediation actions
Process:
Display Health Assessment Summary:
🏥 Azure Resource Health Assessment
📊 Resource Overview:
• Resource: [Name] ([Type])
• Status: [Healthy/Warning/Critical]
• Location: [Region]
• Last Analyzed: [Timestamp]
🚨 Issues Identified:
• Critical: X issues requiring immediate attention
• High: Y issues affecting performance/reliability
• Medium: Z issues for optimization
• Low: N informational items
🔍 Top Issues:
1. [Issue Type]: [Description] - Impact: [High/Medium/Low]
2. [Issue Type]: [Description] - Impact: [High/Medium/Low]
3. [Issue Type]: [Description] - Impact: [High/Medium/Low]
🛠️ Remediation Plan:
• Immediate Actions: X items
• Short-term Fixes: Y items
• Long-term Improvements: Z items
• Estimated Resolution Time: [Timeline]
❓ Proceed with detailed remediation plan? (y/n)
Generate Detailed Report:
# Azure Resource Health Report: [Resource Name]
**Generated**: [Timestamp]
**Resource**: [Full Resource ID]
**Overall Health**: [Status with color indicator]
## 🔍 Executive Summary
[Brief overview of health status and key findings]
## 📊 Health Metrics
- **Availability**: X% over last 24h
- **Performance**: [Average response time/throughput]
- **Error Rate**: X% over last 24h
- **Resource Utilization**: [CPU/Memory/Storage percentages]
## 🚨 Issues Identified
### Critical Issues
- **[Issue 1]**: [Description]
- **Root Cause**: [Analysis]
- **Impact**: [Business impact]
- **Immediate Action**: [Required steps]
### High Priority Issues
- **[Issue 2]**: [Description]
- **Root Cause**: [Analysis]
- **Impact**: [Performance/reliability impact]
- **Recommended Fix**: [Solution steps]
## 🛠️ Remediation Plan
### Phase 1: Immediate Actions (0-2 hours)
```bash
# Critical fixes to restore service
[Azure CLI commands with explanations]
Phase 2: Short-term Fixes (2-24 hours)
# Performance and reliability improvements
[Azure CLI commands with explanations]
Phase 3: Long-term Improvements (1-4 weeks)
# Architectural and preventive measures
[Azure CLI commands and configuration changes]
📈 Monitoring Recommendations
- Alerts to Configure: [List of recommended alerts]
- Dashboards to Create: [Monitoring dashboard suggestions]
- Regular Health Checks: [Recommended frequency and scope]
✅ Validation Steps
📝 Prevention Measures
- [Recommendations to prevent similar issues]
- [Process improvements]
- [Monitoring enhancements]
Error Handling
- Resource Not Found: Provide guidance on resource name/location specification
- Authentication Issues: Guide user through Azure authentication setup
- Insufficient Permissions: List required RBAC roles for resource access
- No Logs Available: Suggest enabling diagnostic settings and waiting for data
- Query Timeouts: Break down analysis into smaller time windows
- Service-Specific Issues: Provide generic health assessment with limitations noted
Success Criteria
- ✅ Resource health status accurately assessed
- ✅ All significant issues identified and categorized
- ✅ Root cause analysis completed for major problems
- ✅ Actionable remediation plan with specific steps provided
- ✅ Monitoring and prevention recommendations included
- ✅ Clear prioritization of issues by business impact
- ✅ Implementation steps include validation and rollback procedures
Source: github/awesome-copilot → skills/azure-resource-health-diagnose/SKILL.md
1---2name: azure-resource-health-diagnose3description: Analyze Azure resource health, diagnose issues from logs and telemetry, and create a remediation plan for identified problems.4---5# Azure Resource Health & Issue Diagnosis67This 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.89## Prerequisites10- Azure MCP server configured and authenticated11- Target Azure resource identified (name and optionally resource group/subscription)12- Resource must be deployed and running to generate logs/telemetry13- Prefer Azure MCP tools (`azmcp-*`) over direct Azure CLI when available1415## Workflow Steps1617### Step 1: Get Azure Best Practices18**Action**: Retrieve diagnostic and troubleshooting best practices19**Tools**: Azure MCP best practices tool20**Process**:211. **Load Best Practices**:22 - Execute Azure best practices tool to get diagnostic guidelines23 - Focus on health monitoring, log analysis, and issue resolution patterns24 - Use these practices to inform diagnostic approach and remediation recommendations2526### Step 2: Resource Discovery & Identification27**Action**: Locate and identify the target Azure resource28**Tools**: Azure MCP tools + Azure CLI fallback29**Process**:301. **Resource Lookup**:31 - If only resource name provided: Search across subscriptions using `azmcp-subscription-list`32 - Use `az resource list --name <resource-name>` to find matching resources33 - If multiple matches found, prompt user to specify subscription/resource group34 - Gather detailed resource information:35 - Resource type and current status36 - Location, tags, and configuration37 - Associated services and dependencies38392. **Resource Type Detection**:40 - Identify resource type to determine appropriate diagnostic approach:41 - **Web Apps/Function Apps**: Application logs, performance metrics, dependency tracking42 - **Virtual Machines**: System logs, performance counters, boot diagnostics43 - **Cosmos DB**: Request metrics, throttling, partition statistics44 - **Storage Accounts**: Access logs, performance metrics, availability45 - **SQL Database**: Query performance, connection logs, resource utilization46 - **Application Insights**: Application telemetry, exceptions, dependencies47 - **Key Vault**: Access logs, certificate status, secret usage48 - **Service Bus**: Message metrics, dead letter queues, throughput4950### Step 3: Health Status Assessment51**Action**: Evaluate current resource health and availability52**Tools**: Azure MCP monitoring tools + Azure CLI53**Process**:541. **Basic Health Check**:55 - Check resource provisioning state and operational status56 - Verify service availability and responsiveness57 - Review recent deployment or configuration changes58 - Assess current resource utilization (CPU, memory, storage, etc.)59602. **Service-Specific Health Indicators**:61 - **Web Apps**: HTTP response codes, response times, uptime62 - **Databases**: Connection success rate, query performance, deadlocks63 - **Storage**: Availability percentage, request success rate, latency64 - **VMs**: Boot diagnostics, guest OS metrics, network connectivity65 - **Functions**: Execution success rate, duration, error frequency6667### Step 4: Log & Telemetry Analysis68**Action**: Analyze logs and telemetry to identify issues and patterns69**Tools**: Azure MCP monitoring tools for Log Analytics queries70**Process**:711. **Find Monitoring Sources**:72 - Use `azmcp-monitor-workspace-list` to identify Log Analytics workspaces73 - Locate Application Insights instances associated with the resource74 - Identify relevant log tables using `azmcp-monitor-table-list`75762. **Execute Diagnostic Queries**:77 Use `azmcp-monitor-log-query` with targeted KQL queries based on resource type:7879 **General Error Analysis**:80 ```kql81 // Recent errors and exceptions82 union isfuzzy=true 83 AzureDiagnostics,84 AppServiceHTTPLogs,85 AppServiceAppLogs,86 AzureActivity87 | where TimeGenerated > ago(24h)88 | where Level == "Error" or ResultType != "Success"89 | summarize ErrorCount=count() by Resource, ResultType, bin(TimeGenerated, 1h)90 | order by TimeGenerated desc91 ```9293 **Performance Analysis**:94 ```kql95 // Performance degradation patterns96 Perf97 | where TimeGenerated > ago(7d)98 | where ObjectName == "Processor" and CounterName == "% Processor Time"99 | summarize avg(CounterValue) by Computer, bin(TimeGenerated, 1h)100 | where avg_CounterValue > 80101 ```102103 **Application-Specific Queries**:104 ```kql105 // Application Insights - Failed requests106 requests107 | where timestamp > ago(24h)108 | where success == false109 | summarize FailureCount=count() by resultCode, bin(timestamp, 1h)110 | order by timestamp desc111 112 // Database - Connection failures113 AzureDiagnostics114 | where ResourceProvider == "MICROSOFT.SQL"115 | where Category == "SQLSecurityAuditEvents"116 | where action_name_s == "CONNECTION_FAILED"117 | summarize ConnectionFailures=count() by bin(TimeGenerated, 1h)118 ```1191203. **Pattern Recognition**:121 - Identify recurring error patterns or anomalies122 - Correlate errors with deployment times or configuration changes123 - Analyze performance trends and degradation patterns124 - Look for dependency failures or external service issues125126### Step 5: Issue Classification & Root Cause Analysis127**Action**: Categorize identified issues and determine root causes128**Process**:1291. **Issue Classification**:130 - **Critical**: Service unavailable, data loss, security breaches131 - **High**: Performance degradation, intermittent failures, high error rates132 - **Medium**: Warnings, suboptimal configuration, minor performance issues133 - **Low**: Informational alerts, optimization opportunities1341352. **Root Cause Analysis**:136 - **Configuration Issues**: Incorrect settings, missing dependencies137 - **Resource Constraints**: CPU/memory/disk limitations, throttling138 - **Network Issues**: Connectivity problems, DNS resolution, firewall rules139 - **Application Issues**: Code bugs, memory leaks, inefficient queries140 - **External Dependencies**: Third-party service failures, API limits141 - **Security Issues**: Authentication failures, certificate expiration1421433. **Impact Assessment**:144 - Determine business impact and affected users/systems145 - Evaluate data integrity and security implications146 - Assess recovery time objectives and priorities147148### Step 6: Generate Remediation Plan149**Action**: Create a comprehensive plan to address identified issues150**Process**:1511. **Immediate Actions** (Critical issues):152 - Emergency fixes to restore service availability153 - Temporary workarounds to mitigate impact154 - Escalation procedures for complex issues1551562. **Short-term Fixes** (High/Medium issues):157 - Configuration adjustments and resource scaling158 - Application updates and patches159 - Monitoring and alerting improvements1601613. **Long-term Improvements** (All issues):162 - Architectural changes for better resilience163 - Preventive measures and monitoring enhancements164 - Documentation and process improvements1651664. **Implementation Steps**:167 - Prioritized action items with specific Azure CLI commands168 - Testing and validation procedures169 - Rollback plans for each change170 - Monitoring to verify issue resolution171172### Step 7: User Confirmation & Report Generation173**Action**: Present findings and get approval for remediation actions174**Process**:1751. **Display Health Assessment Summary**:176 ```177 🏥 Azure Resource Health Assessment178 179 📊 Resource Overview:180 • Resource: [Name] ([Type])181 • Status: [Healthy/Warning/Critical]182 • Location: [Region]183 • Last Analyzed: [Timestamp]184 185 🚨 Issues Identified:186 • Critical: X issues requiring immediate attention187 • High: Y issues affecting performance/reliability 188 • Medium: Z issues for optimization189 • Low: N informational items190 191 🔍 Top Issues:192 1. [Issue Type]: [Description] - Impact: [High/Medium/Low]193 2. [Issue Type]: [Description] - Impact: [High/Medium/Low]194 3. [Issue Type]: [Description] - Impact: [High/Medium/Low]195 196 🛠️ Remediation Plan:197 • Immediate Actions: X items198 • Short-term Fixes: Y items 199 • Long-term Improvements: Z items200 • Estimated Resolution Time: [Timeline]201 202 ❓ Proceed with detailed remediation plan? (y/n)203 ```2042052. **Generate Detailed Report**:206 ```markdown207 # Azure Resource Health Report: [Resource Name]208 209 **Generated**: [Timestamp] 210 **Resource**: [Full Resource ID] 211 **Overall Health**: [Status with color indicator]212 213 ## 🔍 Executive Summary214 [Brief overview of health status and key findings]215 216 ## 📊 Health Metrics217 - **Availability**: X% over last 24h218 - **Performance**: [Average response time/throughput]219 - **Error Rate**: X% over last 24h220 - **Resource Utilization**: [CPU/Memory/Storage percentages]221 222 ## 🚨 Issues Identified223 224 ### Critical Issues225 - **[Issue 1]**: [Description]226 - **Root Cause**: [Analysis]227 - **Impact**: [Business impact]228 - **Immediate Action**: [Required steps]229 230 ### High Priority Issues 231 - **[Issue 2]**: [Description]232 - **Root Cause**: [Analysis]233 - **Impact**: [Performance/reliability impact]234 - **Recommended Fix**: [Solution steps]235 236 ## 🛠️ Remediation Plan237 238 ### Phase 1: Immediate Actions (0-2 hours)239 ```bash240 # Critical fixes to restore service241 [Azure CLI commands with explanations]242 ```243 244 ### Phase 2: Short-term Fixes (2-24 hours)245 ```bash246 # Performance and reliability improvements247 [Azure CLI commands with explanations]248 ```249 250 ### Phase 3: Long-term Improvements (1-4 weeks)251 ```bash252 # Architectural and preventive measures253 [Azure CLI commands and configuration changes]254 ```255 256 ## 📈 Monitoring Recommendations257 - **Alerts to Configure**: [List of recommended alerts]258 - **Dashboards to Create**: [Monitoring dashboard suggestions]259 - **Regular Health Checks**: [Recommended frequency and scope]260 261 ## ✅ Validation Steps262 - [ ] Verify issue resolution through logs263 - [ ] Confirm performance improvements264 - [ ] Test application functionality265 - [ ] Update monitoring and alerting266 - [ ] Document lessons learned267 268 ## 📝 Prevention Measures269 - [Recommendations to prevent similar issues]270 - [Process improvements]271 - [Monitoring enhancements]272 ```273274## Error Handling275- **Resource Not Found**: Provide guidance on resource name/location specification276- **Authentication Issues**: Guide user through Azure authentication setup277- **Insufficient Permissions**: List required RBAC roles for resource access278- **No Logs Available**: Suggest enabling diagnostic settings and waiting for data279- **Query Timeouts**: Break down analysis into smaller time windows280- **Service-Specific Issues**: Provide generic health assessment with limitations noted281282## Success Criteria283- ✅ Resource health status accurately assessed284- ✅ All significant issues identified and categorized285- ✅ Root cause analysis completed for major problems286- ✅ Actionable remediation plan with specific steps provided287- ✅ Monitoring and prevention recommendations included288- ✅ Clear prioritization of issues by business impact289- ✅ Implementation steps include validation and rollback procedures290291---292293**Source:** [`github/awesome-copilot`](https://github.com/github/awesome-copilot) → `skills/azure-resource-health-diagnose/SKILL.md`