Implementing Advanced Features for Web Services

Implementing a Health Check API

Many paid services perform site availability tests that are basic pings, some with more advanced analysis of the HTTP response. ASP.NET Core 2.2 and later make it easy to implement more detailed website health checks. For example, the website might be live, but is it ready? Can it retrieve data from its database?

Let’s add basic health check capabilities to our web service:

Step 1: In the Northwind.WebApi project, add package references to enable Entity Framework Core database health checks, as shown in the following markup:

Get hands-on with 1400+ tech skills courses.