Is there an inbuilt health check for service fabric? I have a guest executable written in NET Core 2.2 and utilising the health check feature within it. For example, I have a simple health check that returns unhealthy state:
services
.AddHealthChecks()
.AddCheck<DocumentDbHealthCheck>("cosmos-database");
internal class DocumentDbHealthCheck : IHealthCheck
{
public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default(CancellationToken))
{
return Task.FromResult(HealthCheckResult.Unhealthy());
}
}
I have hooked this up using:
app.UseHealthChecks(@"/foo/bar/v1/healthcheck");
However, when I locally startup my service fabric instance the state is healthy, I was expecting this to be in an errored / unhealthy state.
Is it possible to have service fabric hit the API healthcheck route?