From the course: ASP.NET Core: Health Checks and Logging

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Configuring health checks

Configuring health checks - ASP.NET Core Tutorial

From the course: ASP.NET Core: Health Checks and Logging

Start my 1-month free trial

Configuring health checks

- [Narrator] Enabling ASP.NET Core health checks, requires changes in our startup class. First of all, we have to go to the configure services method and in there call, AddHealthChecks, a specific new get package will bring that method in. And this registers the middleware that allows us to provide and also to query health checks. The second step is usual is to go to the configure method and specify the health checks we would like to use there. We have the MapHealthChecks method, which can be used to set up one or more end points. And these endpoints then allow us to provide URLs, which can be called to receive the current state of the application. Here we go. We open our start up class, look for the configure service method and add services AddHealthChecks, and this sets everything up and next we go to configure. We need UseRouting and we need UseEndpoints. Both is already in the template, if it isn't, edit. Here…

Contents