Closed ejacobg closed 2 months ago
Remember to also install the AspNetCore.HealthChecks.SqlServer
package from AspNetCore.Diagnostics.HealthChecks.
var hcBuilder = services.AddHealthChecks();
hcBuilder
.AddSqlServer(
configuration["ConnectionString"],
name: "CatalogDB-check",
tags: new string[] { "catalogdb" });
The diagnostics package actually contains health checks for several services. We need to install a few more packages:
AspNetCore.HealthChecks.Azure.Storage.Blobs
(AddAzureBlobStorage()
)AspNetCore.HealthChecks.AzureServiceBus
(AddAzureServiceBusTopic()
)AspNetCore.HealthChecks.Rabbitmq
(AddRabbitMQ()
)
This comes from the Microsoft.Extensions.Diagnostics.HealthChecks package.
Related reading: https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/monitor-app-health