Health Checks in ASP.NET and ASP.NET Core

Ashish Patel
.NET Hub
Published in
3 min readNov 16, 2018

--

How to implement health checks in .NET applications?

Health Checks in .NET

ASP.NET Core offers Health Check Middleware and libraries for reporting the health of app infrastructure components.

Health checks are exposed by an app as HTTP endpoints. Health check endpoints can be configured for a variety of real-time monitoring scenarios:

  • Health probes can be used by container orchestrators and load balancers to check an app’s status. For example, a container orchestrator may respond to a failing health check by halting a rolling deployment or restarting a container. A load balancer might react to an unhealthy app by routing traffic away from the failing instance to a healthy instance.
  • Use of memory, disk, and other physical server resources can be monitored for healthy status.
  • Health checks can test an app’s dependencies, such as databases and external service endpoints, to confirm availability and normal functioning.

Typically health checks are exposed by an application as a simple HTTP endpoint used by monitoring systems. Creating a dedicated health endpoint allows you to specialize the behavior of that endpoint for the needs of monitoring systems.

.NET Core 2.2 (later versions) health checks are introduced right out of the box and with minimal…

--

--

Ashish Patel
.NET Hub

Cloud Architect • 4x AWS Certified • 6x Azure Certified • 1x Kubernetes Certified • MCP • .NET • Terraform • DevOps • Blogger [https://bit.ly/iamashishpatel]