How does your load balancer know your app is healthy? Not just ‘running’, but actually connected to the DB.
// In Program.cs
builder.Services.AddHealthChecks()
.AddSqlServer(builder.Configuration.GetConnectionString("Default"));
app.MapHealthChecks("/health");
The Benefit: It returns a 200 OK only if the app AND its dependencies are healthy. Essential for Kubernetes deployments.
