Step 7

Monitor service health

~5 minutes
Marks this step as complete and saves your progress

The azd app health command provides detailed health status for all your services, helping you quickly identify and troubleshoot issues.

Check Health Status

Get a health overview of all services:

bash
azd app health

Expected Output

Service Health Status

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Service     β”‚ Status   β”‚ Uptime      β”‚ Last Check        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ api         β”‚ βœ“ Healthyβ”‚ 45m 23s     β”‚ 2s ago            β”‚
β”‚ web         β”‚ βœ“ Healthyβ”‚ 45m 22s     β”‚ 2s ago            β”‚
β”‚ postgres    β”‚ βœ“ Healthyβ”‚ 45m 30s     β”‚ 5s ago            β”‚
β”‚ redis       β”‚ βœ“ Healthyβ”‚ 45m 29s     β”‚ 3s ago            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

All services healthy!

Detailed Health Information

Get more details about a specific service:

bash
azd app health --service api --verbose

Health Check Types

azd app supports various health check types based on your service type:

  • HTTP - Checks HTTP endpoints for 2xx responses (default for services with ports)
  • TCP - Verifies TCP port connectivity (for databases, gRPC services)
  • Process - Checks if the process is running (default for services without ports)
  • Output - Matches a regex pattern in stdout (for watch/build services)

Understanding Status vs Health

azd app tracks two independent concepts:

  • Lifecycle State - Is the process running? (starting, running, stopped, etc.)
  • Health Status - Is the service responding correctly? (healthy, unhealthy, degraded)

A running service can be unhealthy (process up, but health checks failing), and a stopped service has no health status. The dashboard shows both clearly.

Streaming Mode

Continuously monitor health status in real-time:

bash
azd app health --stream

Troubleshooting Unhealthy Services

When a service is unhealthy:

  1. Check the service logs: azd app logs --service <name>
  2. View detailed health info: azd app health --service <name> --verbose
  3. Stop services with Ctrl+C and restart with azd app run

Try It Yourself

Run `azd app health` to see the health status of all your services. Try `--stream` mode to see real-time updates.

Expected: You should see a table showing each service's health status, uptime, and when it was last checked.

Custom Health Endpoints

Configure custom health check endpoints in your azure.yaml:

yaml
services:
  api:
    health:
      path: /healthz
      interval: 30s
      timeout: 5s
      retries: 3

JSON Output

For integration with monitoring tools:

bash
azd app health --output json

Exit Codes

  • 0 - All services healthy
  • 1 - One or more services unhealthy
  • 2 - Error checking health