Reputation: 21
I'm trying to implement the AspNetCore.HealthChecks.UI Nuget package and it's working locally on my PC, but when I host it on IIS I'm getting the following error:
This is the configuration in my appsettings.json file:
{
"HealthChecks-UI": {
"HealthChecks": [
{
"Name": "MySiteName",
"Uri": "/healthchecks"
}
]
}
}
I know it can read the endpoint URI from here because if I set it to http://localhost:8888/healthchecks then the error changes to:
I can access the /healthchecks
page directly in the browser and view the JSON output.
In my Program.cs I have:
builder.Services.AddHealthChecks()
.AddCheck<MyCustomHealthCheck1>("Health check 1")
.AddCheck<MyCustomHealthCheck2>("Health check 2")
.AddCheck<MyCustomHealthCheck3>("Health check 3");
builder.Services.AddHealthChecksUI().AddInMemoryStorage();
app.MapHealthChecks("/healthchecks", new HealthCheckOptions
{
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
app.MapHealthChecksUI();
I want to use a relative URI if possible so that users of my web application do not have to configure it in the appsettings.json file. Part of the reason I'm implementing healthchecks UI is to check for configuration errors on our client sites, so requiring it's own configuration is counter intuitive.
Upvotes: 0
Views: 687