ASP.NET Core middleware exposes app infrastructure health via configurable HTTP endpoints.
Go to the source page

Health checks report Healthy, Degraded, or Unhealthy status. Basic config deems app healthy if endpoint responds. Implement IHealthCheck for custom checks returning HealthCheckResult. Register checks with AddHealthChecks and map endpoints with MapHealthChecks. Tags filter health checks by category. RequireAuthorization secures endpoints from unauthorized access. Predicate option runs subset of checks. ResponseWriter customizes output like JSON. SQL Server checks run SELECT 1 query. DbContext checks test EF Core database connectivity. Liveness probes check process aliveness without dependencies. Readiness probes block traffic until startup completes. Publishers push health status periodically. Kubernetes uses separate liveness and readiness probes. Management ports restrict checks to specific hosts. Docker HEALTHCHECK directive probes endpoints.

Microsoft Technology

Comments

Be the first to comment!

Join the discussion

Please confirm that you are not a robot.