---
title: Incident Triage & Health Check Runbook
summary: First-5-minutes triage commands and symptom-first recovery playbooks for Container Apps, passwordless RBAC, order orchestration, vector ingestion, and AI pipelines.
owners:
  - platform-engineering-team
badges:
  - content: SRE / Incident
    backgroundColor: red
    textColor: red
---

## When to Use & Blast Radius

Use this runbook as your primary starting point during any live service degradation, failed checkout, search staleness, or authentication outage. Triage commands are read-only; mitigation commands (restarting revisions or modifying RBAC) affect live traffic for the targeted `<APP_NAME>`.

<Admonition type="warning" title="Production Verification Note">

In `Staging` and `Production`, internal `/health` and `/alive` routes are not exposed externally.
Verify service health using Container App revision status, platform system logs, and **API
Gateway** HTTP responses.

</Admonition>

### Incident Triage Flow

<MermaidFileLoader file="mermaids/003-incident-response-and-runbooks-diagram-1.mmd" />

## Pre-Flight Check

Set the active Azure subscription and list all Container Apps in `<RESOURCE_GROUP>` to identify unhealthy workloads:

```bash
az account set --subscription "<SUBSCRIPTION_ID>"
az containerapp list --resource-group "<RESOURCE_GROUP>" \
  --query "[].{Name:name, Status:properties.runningStatus, LatestRevision:properties.latestRevisionName}" -o table
```

## Procedure (First 5 Minutes)

<Steps>
<Step title="Inspect revision health and replica counts">

Check whether the active revision of `<APP_NAME>` is `Healthy` or stuck in `Activating` / `Failed`:

```bash
az containerapp revision list --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" \
  --query "[].{Revision:name, Active:properties.active, Health:properties.healthState, Provisioning:properties.provisioningState, Replicas:properties.replicas}" \
  -o table
```

</Step>

<Step title="Tail live console and system logs">

Capture real-time application errors and Container App lifecycle events:

```bash
az containerapp logs show --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --type console --tail 100
az containerapp logs show --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --type system --tail 50
```

</Step>

<Step title="Inspect Message Broker dead-letter queue activity">

Check whether **Ordering Service**, **Basket Service**, **Notification Service**, or **Finance Orchestrator** are routing poison messages to native dead-letter queues (`bookworm.<ENV>.<SERVICE>.dead-letter-queue`):

```bash
WORKSPACE_ID=$(az monitor log-analytics workspace list --resource-group "<RESOURCE_GROUP>" --query "[0].customerId" -o tsv)
az monitor log-analytics query --workspace "${WORKSPACE_ID}" \
  --analytics-query "ContainerAppConsoleLogs_CL | where TimeGenerated > ago(1h) | where Log_s has_any ('dead-letter','ConsumeException','Failed') | project TimeGenerated, ContainerAppName_s, Log_s | order by TimeGenerated desc | take 30" \
  -o table
```

</Step>

<Step title="Restart a stalled revision or roll back">

Restart the active revision if the container is deadlocked or recovering from a transient dependency/RBAC propagation delay. If a recent release caused the regression, roll back immediately via [[doc|operational/001-azure-deployment-guide]].

```bash
az containerapp revision restart \
  --name "<APP_NAME>" \
  --resource-group "<RESOURCE_GROUP>" \
  --revision "<REVISION_NAME>"
```

</Step>

<Step title="Consult Azure SRE Agent for automated root-cause correlation">

If an **Azure SRE Agent** is attached to `<RESOURCE_GROUP>`, inspect its active investigation threads to correlate Container Apps revision failures, Application Insights exceptions, and recent deployments before applying manual fixes:

```bash
# Retrieve the Azure SRE Agent endpoint and list recent investigation threads
SRE_ENDPOINT=$(az rest -m GET \
  --url "https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.App/agents/<SRE_AGENT_NAME>?api-version=2025-05-01-preview" \
  --query properties.agentEndpoint -o tsv)
SRE_TOKEN=$(az account get-access-token --resource https://azuresre.dev --query accessToken -o tsv)
curl -s -H "Authorization: Bearer ${SRE_TOKEN}" "${SRE_ENDPOINT}/api/v1/threads"
```

Review any proposed mitigation (such as scaling overrides or revision restarts) in the Azure Portal under your **SRE Agent** resource before approving execution in **Review** mode, or use the `az sre` CLI extension (`az sre --help`).

</Step>

</Steps>

## Domain-Specific Recovery Playbooks

<Accordion title="Playbook 1: Container App Startup or Image Pull Failure">

**Symptoms:** Revision stuck in `Activating`/`Failed`, `ImagePullFailed`, or crash loop.

1. Verify the Container Apps environment Managed Identity holds `AcrPull` on `<ACR_NAME>`:

```bash
ACR_ID=$(az acr show --name "<ACR_NAME>" --resource-group "<RESOURCE_GROUP>" --query id -o tsv)
az role assignment list --scope "${ACR_ID}" \
 --query "[?roleDefinitionName=='AcrPull'].{Principal:principalId, Role:roleDefinitionName}" -o table
```

2. Confirm the target image tag exists in `<ACR_NAME>`:

```bash
az acr repository show-tags --name "<ACR_NAME>" --repository "<APP_NAME>" --orderby time_desc -o table
```

3. Check console logs for missing external parameters (Message Broker, Vector Database, or SMTP relay), then redeploy via `aspire deploy --environment "<ENV>"`.

</Accordion>

<Accordion title="Playbook 2: Passwordless Auth & Entra RBAC Failure (401/403, Token Login Errors)">

**Symptoms:** PostgreSQL token login failure, Redis `NOAUTH`/`NOPERM`, or `403 Forbidden` on Cosmos DB, Blob Storage, or Microsoft Foundry. Never re-enable static passwords or shared keys as a workaround.

1. Confirm PostgreSQL Entra ID admin registration (**Catalog Service**, **Catalog Ingestion**, **Ordering Service**, **Scheduler Service** only):

```bash
az postgres flexible-server ad-admin list --resource-group "<RESOURCE_GROUP>" --server-name "<POSTGRES_SERVER>" -o table
```

2. Inspect Managed Identity role assignments for `<PRINCIPAL_ID>`:

```bash
az role assignment list --resource-group "<RESOURCE_GROUP>" --assignee "<PRINCIPAL_ID>" \
 --query "[].{Role:roleDefinitionName, Scope:scope}" -o table
```

Expected datastore bindings:

- **Azure Storage:** `Storage Blob Data Contributor` for **Catalog Service** and **Chat Service**; `Storage Blob Data Owner` for **Catalog Ingestion** and **Finance Orchestrator**.
- **Microsoft Foundry:** `Cognitive Services User` for **Catalog Service**, **Catalog Ingestion**, **Chat Service**, and **Rating Service**.

3. Wait 5–10 minutes for Entra ID RBAC propagation, then restart the failing revision.

</Accordion>

<Accordion title="Playbook 3: Order Orchestration Stall">

**Symptoms:** Orders stay in `New` status, customer baskets do not clear, or checkout emails never send.

1. Verify **Finance Orchestrator** (`finance`) has **Durable Task Scheduler** and broker settings populated:

```bash
az containerapp show --name finance --resource-group "<RESOURCE_GROUP>" \
 --query "properties.template.containers[0].env[?name=='DTS_CONNECTION_STRING' || name=='TASKHUB_NAME' || name=='BrokerList']" -o table
```

2. Confirm **Finance Orchestrator** holds `Storage Blob Data Owner` on `<STORAGE_ACCOUNT>` and that the Container Apps outbound static IP is in the Durable Task Scheduler allowlist.
3. Inspect logs and dead-letter queues for **Ordering Service**, **Finance Orchestrator**, **Basket Service**, and **Notification Service**. For missing checkout emails, verify **Notification Service** connectivity to the Message Broker, Redis, and SMTP relay.

</Accordion>

<Accordion title="Playbook 4: Vector Search & Catalog Ingestion Lag">

**Symptoms:** Newly created or updated books do not appear in semantic search.

1. Sign in to **Quartz Dashboard** (`https://quartz-dashboard.<DOMAIN>/quartz`) and verify the 5-minute vector batch job is executing without misfires.
2. Tail **Catalog Ingestion** logs:

```bash
az containerapp logs show --name catalog-ingestion --resource-group "<RESOURCE_GROUP>" --type console --tail 100
```

3. If Microsoft Foundry returns HTTP `429` on `embedding`, increase model capacity. If **Qdrant Cloud** fails, verify the vector database connection secret.

</Accordion>

<Accordion title="Playbook 5: AI Chat & PII Redaction Degradation">

**Symptoms:** **Chat Service** (`chatting`) or **Rating Service** (`rating`) returns HTTP `502`/`503`, `429`, or high latency.

1. Check **Privacy Analyzer** and **Privacy Anonymizer** status:

```bash
az containerapp list --resource-group "<RESOURCE_GROUP>" \
 --query "[?name=='presidio-analyzer' || name=='presidio-anonymizer'].{Name:name, Status:properties.runningStatus}" -o table
```

2. Inspect Application Insights **Failures** for HTTP `429` throttling on `chat`, `decision`, or `embedding` deployments.
3. If Agent-to-Agent calls return `401`/`403`, verify Entra Agent Identity Federated Identity Credentials using [[doc|operational/006-secrets-certificates-and-secops-rotation]].

</Accordion>

## Verification

Confirm the affected Container App revision is `Healthy` with active replicas and zero new errors in Log Analytics:

```bash
az containerapp revision list --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" \
  --query "[?properties.active==\`true\`].{Revision:name, Health:properties.healthState, Replicas:properties.replicas}" -o table
```

Expected output:

```text
Revision                    Health    Replicas
--------------------------  --------  ----------
<APP_NAME>--<REVISION_ID>   Healthy   1
```

## Rollback / Escape Hatch

If a revision restart or RBAC adjustment does not restore service within 10 minutes, roll back to the previous known-good revision using [[doc|operational/001-azure-deployment-guide]].
