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."4category: devops-and-infra5source_repo: github/awesome-copilot6source_path: "skills/azure-resource-health-diagnose/SKILL.md"7source_url: https://github.com/github/awesome-copilot/blob/HEAD/skills/azure-resource-health-diagnose/SKILL.md8metadata:9 source: https://skillmd.com/skills/thedixitjain/azure-resource-health-diagnose10---1112# Azure Resource Health & Issue Diagnosis1314This 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.1516## Prerequisites17- Azure MCP server configured and authenticated18- Target Azure resource identified (name and optionally resource group/subscription)19- Resource must be deployed and running to generate logs/telemetry20- Prefer Azure MCP tools (`azmcp-*`) over direct Azure CLI when available2122## Workflow Steps2324### Step 1: Get Azure Best Practices25**Action**: Retrieve diagnostic and troubleshooting best practices26**Tools**: Azure MCP best practices tool27**Process**:281. **Load Best Practices**:29 - Execute Azure best practices tool to get diagnostic guidelines30 - Focus on health monitoring, log analysis, and issue resolution patterns31 - Use these practices to inform diagnostic approach and remediation recommendations3233### Step 2: Resource Discovery & Identification34**Action**: Locate and identify the target Azure resource35**Tools**: Azure MCP tools + Azure CLI fallback36**Process**:371. **Resource Lookup**:38 - If only resource name provided: Search across subscriptions using `azmcp-subscription-list`39 - Use `az resource list --name <resource-name>` to find matching resources40 - If multiple matches found, prompt user to specify subscription/resource group41 - Gather detailed resource information:42 - Resource type and current status43 - Location, tags, and configuration44 - Associated services and dependencies45462. **Resource Type Detection**:47 - Identify resource type to determine appropriate diagnostic approach:48 - **Web Apps/Function Apps**: Application logs, performance metrics, dependency tracking49 - **Virtual Machines**: System logs, performance counters, boot diagnostics50 - **Cosmos DB**: Request metrics, throttling, partition statistics51 - **Storage Accounts**: Access logs, performance metrics, availability52 - **SQL Database**: Query performance, connection logs, resource utilization53 - **Application Insights**: Application telemetry, exceptions, dependencies54 - **Key Vault**: Access logs, certificate status, secret usage55 - **Service Bus**: Message metrics, dead letter queues, throughput5657### Step 3: Health Status Assessment58**Action**: Evaluate current resource health and availability59**Tools**: Azure MCP monitoring tools + Azure CLI60**Process**:611. **Basic Health Check**:62 - Check resource provisioning state and operational status63 - Verify service availability and responsiveness64 - Review recent deployment or configuration changes65 - Assess current resource utilization (CPU, memory, storage, etc.)66672. **Service-Specific Health Indicators**:68 - **Web Apps**: HTTP response codes, response times, uptime69 - **Databases**: Connection success rate, query performance, deadlocks70 - **Storage**: Availability percentage, request success rate, latency71 - **VMs**: Boot diagnostics, guest OS metrics, network connectivity72 - **Functions**: Execution success rate, duration, error frequency7374### Step 4: Log & Telemetry Analysis75**Action**: Analyze logs and telemetry to identify issues and patterns76**Tools**: Azure MCP monitoring tools for Log Analytics queries77**Process**:781. **Find Monitoring Sources**:79 - Use `azmcp-monitor-workspace-list` to identify Log Analytics workspaces80 - Locate Application Insights instances associated with the resource81 - Identify relevant log tables using `azmcp-monitor-table-list`82832. **Execute Diagnostic Queries**:84 Use `azmcp-monitor-log-query` with targeted KQL queries based on resource type:8586 **General Error Analysis**:87 ```kql88 // Recent errors and exceptions89 union isfuzzy=true 90 AzureDiagnostics,91 AppServiceHTTPLogs,92 AppServiceAppLogs,93 AzureActivity94 | where TimeGenerated > ago(24h)95 | where Level == "Error" or ResultType != "Success"96 | summarize ErrorCount=count() by Resource, ResultType, bin(TimeGenerated, 1h)97 | order by TimeGenerated desc98 ```99100 **Performance Analysis**:101 ```kql102 // Performance degradation patterns103 Perf104 | where TimeGenerated > ago(7d)105 | where ObjectName == "Processor" and CounterName == "% Processor Time"106 | summarize avg(CounterValue) by Computer, bin(TimeGenerated, 1h)107 | where avg_CounterValue > 80108 ```109110 **Application-Specific Queries**:111 ```kql112 // Application Insights - Failed requests113 requests114 | where timestamp > ago(24h)115 | where success == false116 | summarize FailureCount=count() by resultCode, bin(timestamp, 1h)117 | order by timestamp desc118 119 // Database - Connection failures120 AzureDiagnostics121 | where ResourceProvider == "MICROSOFT.SQL"122 | where Category == "SQLSecurityAuditEvents"123 | where action_name_s == "CONNECTION_FAILED"124 | summarize ConnectionFailures=count() by bin(TimeGenerated, 1h)125 ```1261273. **Pattern Recognition**:128 - Identify recurring error patterns or anomalies129 - Correlate errors with deployment times or configuration changes130 - Analyze performance trends and degradation patterns131 - Look for dependency failures or external service issues132133### Step 5: Issue Classification & Root Cause Analysis134**Action**: Categorize identified issues and determine root causes135**Process**:1361. **Issue Classification**:137 - **Critical**: Service unavailable, data loss, security breaches138 - **High**: Performance degradation, intermittent failures, high error rates139 - **Medium**: Warnings, suboptimal configuration, minor performance issues140 - **Low**: Informational alerts, optimization opportunities1411422. **Root Cause Analysis**:143 - **Configuration Issues**: Incorrect settings, missing dependencies144 - **Resource Constraints**: CPU/memory/disk limitations, throttling145 - **Network Issues**: Connectivity problems, DNS resolution, firewall rules146 - **Application Issues**: Code bugs, memory leaks, inefficient queries147 - **External Dependencies**: Third-party service failures, API limits148 - **Security Issues**: Authentication failures, certificate expiration1491503. **Impact Assessment**:151 - Determine business impact and affected users/systems152 - Evaluate data integrity and security implications153 - Assess recovery time objectives and priorities154155### Step 6: Generate Remediation Plan156**Action**: Create a comprehensive plan to address identified issues157**Process**:1581. **Immediate Actions** (Critical issues):159 - Emergency fixes to restore service availability160 - Temporary workarounds to mitigate impact161 - Escalation procedures for complex issues1621632. **Short-term Fixes** (High/Medium issues):164 - Configuration adjustments and resource scaling165 - Application updates and patches166 - Monitoring and alerting improvements1671683. **Long-term Improvements** (All issues):169 - Architectural changes for better resilience170 - Preventive measures and monitoring enhancements171 - Documentation and process improvements1721734. **Implementation Steps**:174 - Prioritized action items with specific Azure CLI commands175 - Testing and validation procedures176 - Rollback plans for each change177 - Monitoring to verify issue resolution178179### Step 7: User Confirmation & Report Generation180**Action**: Present findings and get approval for remediation actions181**Process**:1821. **Display Health Assessment Summary**:183 ```184 🏥 Azure Resource Health Assessment185 186 📊 Resource Overview:187 • Resource: [Name] ([Type])188 • Status: [Healthy/Warning/Critical]189 • Location: [Region]190 • Last Analyzed: [Timestamp]191 192 🚨 Issues Identified:193 • Critical: X issues requiring immediate attention194 • High: Y issues affecting performance/reliability 195 • Medium: Z issues for optimization196 • Low: N informational items197 198 🔍 Top Issues:199 1. [Issue Type]: [Description] - Impact: [High/Medium/Low]200 2. [Issue Type]: [Description] - Impact: [High/Medium/Low]201 3. [Issue Type]: [Description] - Impact: [High/Medium/Low]202 203 🛠️ Remediation Plan:204 • Immediate Actions: X items205 • Short-term Fixes: Y items 206 • Long-term Improvements: Z items207 • Estimated Resolution Time: [Timeline]208 209 ❓ Proceed with detailed remediation plan? (y/n)210 ```2112122. **Generate Detailed Report**:213 ```markdown214 # Azure Resource Health Report: [Resource Name]215 216 **Generated**: [Timestamp] 217 **Resource**: [Full Resource ID] 218 **Overall Health**: [Status with color indicator]219 220 ## 🔍 Executive Summary221 [Brief overview of health status and key findings]222 223 ## 📊 Health Metrics224 - **Availability**: X% over last 24h225 - **Performance**: [Average response time/throughput]226 - **Error Rate**: X% over last 24h227 - **Resource Utilization**: [CPU/Memory/Storage percentages]228 229 ## 🚨 Issues Identified230 231 ### Critical Issues232 - **[Issue 1]**: [Description]233 - **Root Cause**: [Analysis]234 - **Impact**: [Business impact]235 - **Immediate Action**: [Required steps]236 237 ### High Priority Issues 238 - **[Issue 2]**: [Description]239 - **Root Cause**: [Analysis]240 - **Impact**: [Performance/reliability impact]241 - **Recommended Fix**: [Solution steps]242 243 ## 🛠️ Remediation Plan244 245 ### Phase 1: Immediate Actions (0-2 hours)246 ```bash247 # Critical fixes to restore service248 [Azure CLI commands with explanations]249 ```250 251 ### Phase 2: Short-term Fixes (2-24 hours)252 ```bash253 # Performance and reliability improvements254 [Azure CLI commands with explanations]255 ```256 257 ### Phase 3: Long-term Improvements (1-4 weeks)258 ```bash259 # Architectural and preventive measures260 [Azure CLI commands and configuration changes]261 ```262 263 ## 📈 Monitoring Recommendations264 - **Alerts to Configure**: [List of recommended alerts]265 - **Dashboards to Create**: [Monitoring dashboard suggestions]266 - **Regular Health Checks**: [Recommended frequency and scope]267 268 ## ✅ Validation Steps269 - [ ] Verify issue resolution through logs270 - [ ] Confirm performance improvements271 - [ ] Test application functionality272 - [ ] Update monitoring and alerting273 - [ ] Document lessons learned274 275 ## 📝 Prevention Measures276 - [Recommendations to prevent similar issues]277 - [Process improvements]278 - [Monitoring enhancements]279 ```280281## Error Handling282- **Resource Not Found**: Provide guidance on resource name/location specification283- **Authentication Issues**: Guide user through Azure authentication setup284- **Insufficient Permissions**: List required RBAC roles for resource access285- **No Logs Available**: Suggest enabling diagnostic settings and waiting for data286- **Query Timeouts**: Break down analysis into smaller time windows287- **Service-Specific Issues**: Provide generic health assessment with limitations noted288289## Success Criteria290- ✅ Resource health status accurately assessed291- ✅ All significant issues identified and categorized292- ✅ Root cause analysis completed for major problems293- ✅ Actionable remediation plan with specific steps provided294- ✅ Monitoring and prevention recommendations included295- ✅ Clear prioritization of issues by business impact296- ✅ Implementation steps include validation and rollback procedures297298---299300**Source:** [`github/awesome-copilot`](https://github.com/github/awesome-copilot) → `skills/azure-resource-health-diagnose/SKILL.md`