Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit f3797d0

Browse files
davidfowlDamianEdwards
authored andcommitted
Minor tweaks to 6
1 parent 153b0b7 commit f3797d0

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

docs/6. Production Readiness and Deployment.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Production Readiness and Deployment
22

33
## Adding EF Healthchecks to the BackEnd
4-
1. Add a package reference to **Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore** version 2.2.0.
4+
1. Add a reference to the NuGet package `Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore` version `2.2.0`.
5+
> This can be done from the command line using `dotnet add package Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore --version 2.2.0`
56
1. Add a DbContext health check in `Startup.cs` by adding the following code to `ConfigureServices`:
67
```csharp
78
services.AddHealthChecks()
@@ -11,7 +12,10 @@
1112
1. Test the end point by navigating to `/health`, it should return the text `Healthy`.
1213

1314
## Adding EF Healthchecks to the FrontEnd
14-
1. Add a package reference to **Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore** version 2.2.0.
15+
1. Add a reference to the NuGet package `Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore` version `3.0.0-preview6.19307.2`.
16+
> This can be done from the command line using `dotnet add package Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore --version 3.0.0-preview6.19307.2`
17+
18+
> Note: The `FrontEnd` and `BackEnd` projects have different versions of this package because they reference different versions of EntityFrameworkCore.
1519
1. Add a DbContext health check in `Startup.cs` by adding the following code to `ConfigureServices`:
1620
```csharp
1721
services.AddHealthChecks()
@@ -21,7 +25,14 @@
2125
1. Test the end point by navigating to `/health`, it should return the text `Healthy`.
2226

2327
## Adding a custom health check to test for BackEnd availability
24-
1. Add a `Task<bool> CheckHealthAsync()` method to `IApiClient`.
28+
1. Add a `CheckHealthAsync` method to `IApiClient`.
29+
```c#
30+
public interface IApiClient
31+
{
32+
...
33+
Task<bool> CheckHealthAsync();
34+
}
35+
```
2536
1. Implement the `CheckHealthAsync` method in `ApiClient` by adding the following code:
2637
```csharp
2738
public async Task<bool> CheckHealthAsync()
@@ -76,7 +87,7 @@
7687
```csharp
7788
services.AddHealthChecks()
7889
.AddCheck<BackendHealthCheck>("backend")
79-
.AddDbContextCheck<IdentityDbContext>();
90+
.AddDbContextCheck<IdentityDbContext>();
8091
```
8192
1. Test the end point by navigating to `/health`, it should return the text `Healthy`.
8293

0 commit comments

Comments
 (0)