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.

Solution: Implementing resiliency capabilities

Solution: Implementing resiliency capabilities

(cheerful music) - [Instructor] Let me show you how we can solve the challenge. First, we need to use here, in the Hospital microservice, the same NuGet package that we used in Pet. So this is the one, Microsoft.Extensions. Diagnostics.HealthChecks.EntityFrameworkcore. So I'm going to copy the entire PackageReference and I'm going to use it right here. And then let's open Program. And right here, let's use builder.Services.AddHealthChecks. And I'm going to use .AddDbContextCheck. So we need to know the type of the DB context that is right here. So it's HospitalDbContext right there. And right here, app.UseHealthChecks, and let's use /health. So now we need to modify the dapr.yaml file, and let's copy this right here. And then we need to modify the resiliency file. So let's open up Visual Studio Code. So here we need to remove this policy. Let's remove it. And we need to use all the different policies in pet, rescuequery, and hospital. So for instance, let's use the timeout that we…

Contents