Skip to content

Commit 14f2a7c

Browse files
fix: disable rate limiting on /health and /alive endpoints
Health probe endpoints must be exempt from the global rate limiter. Azure Container App probes hit these paths every 10s as anonymous IP; without the exemption they hit the 30/min limit after ~5 min and return 429, causing Azure to mark the container unhealthy and restart it. Previously only tracing was excluded (line 64-65); rate limiting was not. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8968460 commit 14f2a7c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

EssentialCSharp.Web/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,11 @@ await McpJsonRpcResponseWriter.WriteErrorAsync(
490490
app.UseForwardedHeaders();
491491
}
492492

493-
app.MapHealthChecks("/health");
493+
app.MapHealthChecks("/health").DisableRateLimiting();
494494
app.MapHealthChecks("/alive", new HealthCheckOptions
495495
{
496496
Predicate = r => r.Tags.Contains("live")
497-
});
497+
}).DisableRateLimiting();
498498

499499
if (app.Environment.IsDevelopment())
500500
{

0 commit comments

Comments
 (0)