From the course: Complete Guide to Dapr for .NET and Azure Developers: Building and Managing Microservices
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Implementing app health checks
From the course: Complete Guide to Dapr for .NET and Azure Developers: Building and Managing Microservices
Implementing app health checks
- [Instructor] ASP. NET Core includes health checks that automatically detect when an application becomes unresponsive. We can use these health endpoints in Dapr to immediately short-circuit incoming service invocation requests, unregister from pub/sub subscriptions, and stop all input bindings. Let's implement a health check for the DbContext in the Pet microservice. The service will be reported as unhealthy if database connectivity is unavailable. So let's go ahead, and here in the Pet.Api project, we can see that we have those package references and we need the Microsoft.Extensions.Diagnostics HealthChecks.EntityFrameworkCore package, since I want to use the DbContext for identifying when there's connection to the database. So let's go here and expand the project, and let's open Program, and then let's add builder.Services, and then AddHealthChecks, and let's use AddDbContextCheck. Let's see the name of the DbContext. This is PetDbContext, so PetDbContext, and that's it. Now we…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Understanding the resiliency capabilities in Dapr1m 25s
-
(Locked)
Creating and implementing retry resiliency policies6m 22s
-
(Locked)
Creating and implementing timeout resiliency policies2m 32s
-
(Locked)
Creating and implementing circuit breaker resiliency policies5m 43s
-
(Locked)
Implementing app health checks6m 50s
-
(Locked)
Challenge: Implementing resiliency capabilities40s
-
(Locked)
Solution: Implementing resiliency capabilities3m 52s
-
(Locked)
-
-
-
-
-
-
-
-