Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Diagnose Azure service issues, query logs, and troubleshoot failures using GitHub Copilot for Azure
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/container-apps/README.md
1# Container Apps Troubleshooting23### Common Issues Matrix45| Symptom | Likely Cause | Quick Fix |6|---------|--------------|-----------|7| Image pull failure | ACR credentials missing | `az containerapp registry set --identity system` |8| ACR build fails | ACR Tasks disabled (free sub) | Build locally with Docker |9| Cold start timeout | min-replicas=0 | `az containerapp update --min-replicas 1` |10| Port mismatch | Wrong target port | Check Dockerfile EXPOSE matches ingress |11| App keeps restarting | Health probe failing | Verify `/health` endpoint |1213### Image Pull Failures1415**Diagnose:**16```bash17# Check registry configuration18az containerapp show --name APP -g RG --query "properties.configuration.registries"1920# Check revision status21az containerapp revision list --name APP -g RG --output table22```2324**Fix:**25```bash26az containerapp registry set \27--name APP -g RG \28--server ACR.azurecr.io \29--identity system30```3132### ACR Tasks Disabled (Free Subscriptions)3334**Symptom:** `az acr build` fails with "ACR Tasks is not supported"3536**Fix: Build locally instead:**37```bash38docker build -t ACR.azurecr.io/myapp:v1 .39az acr login --name ACR40docker push ACR.azurecr.io/myapp:v141```4243### Cold Start Issues4445**Symptom:** First request very slow or times out4647**Fix:**48```bash49az containerapp update --name APP -g RG --min-replicas 150```5152### Health Probe Failures5354**Symptom:** Container keeps restarting5556**Check:**57```bash58# View health probe config59az containerapp show --name APP -g RG --query "properties.configuration.ingress"6061# Check if /health endpoint responds62curl https://APP.REGION.azurecontainerapps.io/health63```6465**Fix:** Ensure app has health endpoint returning 200:66```javascript67app.get('/health', (req, res) => res.sendStatus(200));68```6970### Port Mismatch7172**Symptom:** App starts but returns 502/5037374**Check:**75```bash76az containerapp show --name APP -g RG --query "properties.configuration.ingress.targetPort"77```7879**Verify:** App must listen on this exact port. Check:80- Dockerfile `EXPOSE` statement81- `process.env.PORT` or hardcoded port in app8283### View Logs8485```bash86# Stream logs (wait for replicas if scale-to-zero)87az containerapp logs show --name APP -g RG --follow8889# Recent logs90az containerapp logs show --name APP -g RG --tail 1009192# System logs (startup issues)93az containerapp logs show --name APP -g RG --type system94```9596### Get All Diagnostic Info9798```bash99# Combined diagnostic command100echo "=== Container App Diagnostics ===" && \101echo "Revisions:" && az containerapp revision list --name APP -g RG -o table && \102echo "Registry Config:" && az containerapp show --name APP -g RG --query "properties.configuration.registries" && \103echo "Ingress Config:" && az containerapp show --name APP -g RG --query "properties.configuration.ingress" && \104echo "Recent Logs:" && az containerapp logs show --name APP -g RG --tail 20105```106