← All runbooks
microsoft / azure-observability

Azure Observability Services

Query metrics, logs, and traces across Azure Monitor, Application Insights, and Log Analytics. This runbook enables an agent to access Azure Monitor metrics, Application Insights APM data, and Log Analytics KQL queries through MCP tools or Azure CLI commands…

agent claude-codemodel anthropic/claude-sonnet-4.6snapshot python312-uveval programmatic8 stepsv1.0.0

Deploy Azure Observability Services to your jetty.io

One-click installs this runbook into a collection on your Jetty account. You can run it from the Spot dashboard, schedule it, or pipe inputs in via the API.

The shape of the run

8 steps · start to finish.

  1. 1
    Step 1

    Environment Setup

    Verify Azure CLI is installed and the user is authenticated.

    echo "=== Environment Setup ==="
    
    # Verify required tools
    command -v az  >/dev/null || { echo "ERROR: Azure CLI not installed"; exit 1; }
    command -v jq  >/dev/null || { echo "ERROR: jq not installed"; exit 1; }
    
    # Verify Azure authentication
    az account show --output table || { echo "ERROR: Not logged in to Azure. Run 'az login'"; exit 1; }
    
    # Create output directory
    mkdir -p /app/results
    
    echo "Environment ready."
    echo "Subscription: $(az account show --query 'name' -o tsv)"
    echo "Tenant: $(az account show --query 'tenantId' -o tsv)"
    

    If Azure MCP is available: Check MCP connectivity with azure__monitor tool first. If MCP is not enabled, run /azure:setup or enable via /mcp.

  2. 2
    Step 2

    Discover Resources

    List available Azure Monitor resources, Log Analytics workspaces, and Application Insights components.

  3. 3
    Step 3

    Query Metrics

    Query Azure Monitor metrics for the target resource.

  4. 4
    Step 4

    Query Logs with KQL

    Run KQL queries against Log Analytics to retrieve application logs, errors, and performance data.

  5. 5
    Step 5

    Query Application Insights

    Retrieve APM data, distributed traces, and dependency information from Application Insights.

  6. 6
    Step 6

    Iterate on Errors (max 3 rounds)

    If any queries fail, apply targeted fixes:

  7. 7
    Step 7

    Generate Monitoring Report

    Synthesize the collected observability data into a human-readable report.

  8. 8
    Step 8

    Final Checklist (MANDATORY — do not skip)

    echo "=== FINAL OUTPUT VERIFICATION ===" RESULTS_DIR="/app/results" for f in \ "$RESULTS_DIR/summary.md" \