AI Debugging

Use GitHub Copilot and other AI assistants to diagnose issues, analyze logs, and understand your services through natural conversation.

How It Works

1. Ask a Question

Describe the issue in natural language

2. MCP Gathers Data

AI uses MCP tools to check services

3. Get Insights

AI explains issues and suggests fixes

Example: Finding a Bug

GitHub Copilot
MCP
Why is my API service failing?
Let me check the logs for your API service...
Calling get_service_logs...
I found the issue. Your API is failing due to a database connection timeout.
The error is in your connection configuration:
python src/api/db.py
# Line 42 - timeout is too short
connection = Database(
    host="localhost",
    timeout=1  # Should be at least 5
)
Increase the timeout to 5 seconds and the connection will succeed.

Debugging Workflows

Diagnose Errors

When a service is failing or returning errors

Steps

  1. Ask: "Which services are having issues?"
  2. Get service health status via MCP
  3. Ask: "Show me errors from [service name]"
  4. AI analyzes logs and identifies the root cause
  5. Get suggested fixes

Try these prompts

Monitor Health

Keep track of service status and performance

Steps

  1. Ask: "What's the health status of all services?"
  2. MCP checks each service's health endpoint
  3. AI reports healthy vs unhealthy services
  4. For unhealthy services, AI explains why

Try these prompts

Analyze Logs

Search and understand log output

Steps

  1. Ask: "Show me logs from the last 5 minutes"
  2. MCP streams recent logs
  3. Ask: "Find any errors or warnings"
  4. AI highlights important log entries

Try these prompts

Understand Configuration

Get help with project setup and configuration

Steps

  1. Ask: "What services are configured in this project?"
  2. MCP reads azure.yaml and project structure
  3. AI explains the service architecture
  4. Get help with configuration issues

Try these prompts

Tips for Effective AI Debugging

Be Specific

Instead of "something is broken", say "the API is returning 500 errors when I call /users endpoint".

Name Your Services

Reference specific service names from your azure.yaml like "the web service" or "the api container".

Include Timeframes

"Show me errors from the last 10 minutes" helps narrow down relevant logs.

Follow Up

Ask follow-up questions to dig deeper. "Why did that error happen?" or "Show me more context around that log".

MCP Tools for Debugging

get_services

Lists all services with their current status (running, stopped, error)

get_service_logs

Retrieves logs from a specific service, optionally filtered by time or level

check_requirements

Verifies all prerequisites are met (Node.js, Python, Docker, etc.)

get_project_info

Returns project configuration from azure.yaml

get_environment_variables

Shows environment variables for services (secrets redacted)

Continue Learning