diff --git a/packages/ai-service/app/routers/health.py b/packages/ai-service/app/routers/health.py index 368c864..1bdee67 100644 --- a/packages/ai-service/app/routers/health.py +++ b/packages/ai-service/app/routers/health.py @@ -5,7 +5,10 @@ router = APIRouter() -@router.get("/health") +# Accept HEAD as well as GET: the container HEALTHCHECK (wget --spider) and App +# Service's warmup probe issue HEAD requests. A GET-only route answers HEAD with +# 405, which marks the container perpetually unhealthy and App Service kills it. +@router.api_route("/health", methods=["GET", "HEAD"]) async def health_check(): return { "status": "ok",