Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion python/agent-framework/sample-agent/host_agent_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,17 @@ async def health(_req: Request) -> Response:

middlewares = []
if auth_configuration:
middlewares.append(jwt_authorization_middleware)

@web_middleware
async def jwt_with_health_bypass(request, handler):
# Skip JWT validation for health endpoint so that container
# orchestrators (Azure Container Apps, Kubernetes, App Service)
# can reach /api/health without a bearer token.
if request.path == "/api/health":
return await handler(request)
return await jwt_authorization_middleware(request, handler)

middlewares.append(jwt_with_health_bypass)

@web_middleware
async def anonymous_claims(request, handler):
Expand Down
Loading