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.
Adding database health checks - ASP.NET Core Tutorial
From the course: ASP.NET Core: Health Checks and Logging
Adding database health checks
- [Instructor] So our web application depends on the API and the API depends on the database. So how about we shut down the database? I stop it. And then after it has been shut down, I can add a health check, which gives me that information. Now, truth to be told, problem more or less is that I've put all the database information in the API, so I could now add a health check feature to the API. And the API would then query the status of the database but to make things a little bit more simple, I just queried the status of the database directly from the web project. But the mechanisms I think are obvious. So you could also refactor this so that the API has this health check and exposes this information. How do we do this? Well, of course, we have our AddHealthChecks method and within that method, we can do AddCheck and then for instance, reference DbHealthCheck. A DbHealthCheck is a class we need to implement.…
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)