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 - ASP.NET Core Tutorial
From the course: ASP.NET Core: Health Checks and Logging
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Health checks explained1m 20s
-
(Locked)
Configuring health checks2m 33s
-
(Locked)
Adding health checks4m 31s
-
(Locked)
Adding database health checks7m 12s
-
(Locked)
Creating a UI8m 10s
-
(Locked)
Securing health check endpoints6m 42s
-
(Locked)
Challenge: Add a health check to the sample app1m 5s
-
(Locked)
Solution: Add a health check to the sample app7m 39s
-
(Locked)
Summary of health checks1m 28s
-
(Locked)