Azure resource health diagnose

From mouadja02/skills · View interactive version

Azure resource health diagnose is an AI agent skill from the GitHub repository mouadja02/skills. Analyze Azure resource health, diagnose issues from logs and telemetry, and create a remediation plan for identified problems. Use when an Azure resource is unhealthy, slow, or failing and the cause is unknown.

How to use this skill

Skill file

Attribution: Sourced from github/awesome-copilot by GitHub Community, licensed MIT. Modified for this collection.

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

Workflow Steps

Step 1: Get Azure Best Practices

Action: Retrieve diagnostic and troubleshooting best practices

Tools: Azure MCP best practices tool

Process:

  1. Load Best Practices:

Step 2: Resource Discovery & Identification

Action: Locate and identify the target Azure resource

Tools: Azure MCP tools + Azure CLI fallback

Process:

  1. Resource Lookup:
  1. Resource Type Detection:

Step 3: Health Status Assessment

Action: Evaluate current resource health and availability

Tools: Azure MCP monitoring tools + Azure CLI

Process:

  1. Basic Health Check:
  1. Service-Specific Health Indicators:

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:

  1. Find Monitoring Sources:
  1. Execute Diagnostic Queries:

Use azmcp-monitor-log-query with targeted KQL queries based on resource type:

General Error Analysis:

```kql

// 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:

```kql

// 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:

```kql

// 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)

```

  1. Pattern Recognition:

Step 5: Issue Classification & Root Cause Analysis

Action: Categorize identified issues and determine root causes

Process:

  1. Issue Classification:
  1. Root Cause Analysis:
  1. Impact Assessment:

Step 6: Generate Remediation Plan

Action: Create a comprehensive plan to address identified issues

Process:

  1. Immediate Actions (Critical issues):
  1. Short-term Fixes (High/Medium issues):
  1. Long-term Improvements (All issues):
  1. Implementation Steps:

Step 7: User Confirmation & Report Generation

Action: Present findings and get approval for remediation actions

Process:

  1. 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)

```

  1. Generate Detailed Report:

```markdown

# 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

## 🚨 Issues Identified

### Critical Issues

### High Priority Issues

## 🛠️ 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)

```bash

# Performance and reliability improvements

[Azure CLI commands with explanations]

```

### Phase 3: Long-term Improvements (1-4 weeks)

```bash

# Architectural and preventive measures

[Azure CLI commands and configuration changes]

```

## 📈 Monitoring Recommendations

## ✅ Validation Steps

## 📝 Prevention Measures

```

Error Handling

Success Criteria

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.