fix: fail-fast config validation and post-deploy smoke test#77
Conversation
Add startup validation to Program.cs that throws immediately if any required JWT config values are absent. This surfaces missing env vars as a clear error in Azure logs on boot rather than as silent 500s at runtime. Add a post-deploy smoke test to deploy.yml that retries /api/weatherforecasts up to 5 times (15s apart) after deployment. The workflow fails if the endpoint does not return HTTP 200, preventing a broken deploy from going undetected. Root cause documented in issue #76. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-77.eastus2.2.azurestaticapps.net |
|
This PR addresses the production incident from 2026-03-16 where PR #72 deployed successfully but caused ~3 hours of 500s on all auth endpoints. Full RCA in issue #76. What went wrong: Three env vars ( Two layers of defence added: 1. Fail-fast startup validation ( Azure surfaces this as a startup crash in the logs — no more silent 500s. 2. Post-deploy smoke test ( |
Add /health/live (liveness, no DB check) and /health/ready (readiness, includes SQL Server check) using ASP.NET Core built-in health checks + AspNetCore.HealthChecks.SqlServer. The deploy smoke test hits /health/live so a sleeping serverless Azure SQL DB does not cause false failures. /health/ready is available for uptime monitoring and alerting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-77.eastus2.2.azurestaticapps.net |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://green-water-08792290f-77.eastus2.2.azurestaticapps.net |
Closes #75
Changes
Program.cs— fail-fast startup validationChecks
Jwt:Key,Jwt:Issuer, andJwt:Audienceat startup and throwsInvalidOperationExceptionwith a clear message listing which values are missing. The app refuses to start rather than booting successfully and returning 500s at runtime.deploy.yml— post-deploy smoke testAfter every deploy, curls
/api/weatherforecastsup to 5 times (15s apart). The workflow fails if HTTP 200 is not returned, so a broken deploy is caught in CI before any user sees it.Root Cause Analysis
See issue #76 for the full incident RCA.