A health check endpoint reports whether an application is ready to receive traffic or is operating healthily. During deployment, it prevents a workflow from advancing before a newly installed version can serve requests safely. Common endpoints are `/health/ready`, which returns an OK or not-OK readiness status during startup, and `/health/lively`, which reports healthy, degraded, or unhealthy operation after deployment. section 9.3.4
Poll `/health/ready` after installation and inspect its JSON status. Continue only when the response signals `Healthy`; then run end-to-end tests or the next deployment stage. This makes readiness an explicit deployment gate rather than relying on a fixed delay. section 9.3.4 section 9.3.7
Listing 9.9 Checking the health status
- name: ensure deployment is healthy before we test
run: |
HEALTH_ENDPOINT="https://${{stagingurl}}/health/ready"
while true; do
response=$(curl -s "$HEALTH_ENDPOINT")
status=$(echo "$response" | jq -r '.status')
if [[ "$status" == "Healthy" ]]; then
echo "Health endpoint current status :" $status
break
fi
echo "Waiting for health endpoint..."
sleep 1
done
env:
homepage: ${{ needs.deploy.outputs.homepage }}
This shell step repeatedly calls a staging readiness URL with `curl`, extracts `.status` with `jq`, and waits one second between attempts until the application reports `Healthy`. section 9.3.4
Use the two endpoint roles differently in delivery workflows:
- Gate startup progression with `/health/ready`; once it is healthy, begin validation such as end-to-end tests. section 9.3.4 section 9.3.7
- Monitor `/health/lively` while gradually shifting traffic; abort and roll back if repeated responses show a degraded or unhealthy state. section 9.3.4
- Combine health checks with environment gates when moving between deployment stages. section 9.4
Validate a staging slot before traffic routing
Deploy a release artifact to an Azure Web App staging slot, capture its URL, and poll `${homepage}/health/ready`. After it returns `Healthy`, run Playwright tests. Only then route 10% of traffic to the staging slot, observe behavior, increase traffic when appropriate, and swap slots when confidence is sufficient. section 9.3.7




