You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We then have our own /health function endpoint that injects HealthCheckService and returns the UIHealthReport when requested.
But having upgraded to dotnet core 3.1, this seems to fail a new validation check, described in PR comment as "Adding breaking changes/compatibility analysis"
It lists 6 implementations of IHostedService that are expected, plus 4 more that are optional. If it finds any others, it throws an exception. i.e. this is now a closed system.
The AddHealthChecks() method registers an IHostedService called HealthCheckPublisherHostedService. It attempts to extend what is now closed, and so the validation check throws during startup.
NB. If I add this cursed line of code to knock out the offending registration, it makes the validation happy:
(I have to compare the name as a string because the class is internal.) And then our /health function endpoint responds with healthy (2) but I don't know if it's actually doing any healthchecks anymore.
Is there a "right" way to do this now? Looks like this extension now breaks some fundamental assumption recently adopted by the WebJobs/AF hosting code.
To Reproduce
Attempt to use AddHealthChecks() inside Azure Functions service collection registration. It throws the new validation exception during startup.
Expected behavior
The healthcheck capability works, as in 2.x.
The text was updated successfully, but these errors were encountered:
@rynowak (that's a different Daniel). I already notified them, see link above. It's not so much their code causing the issue. They've merely added a check to make explicit that I've been using an unsupported scenario up to now and there's nothing I can do about that.
Describe the bug
We use Azure functions dependency injection, and we call AddHealthChecks() on the service collection.
We then have our own
/health
function endpoint that injectsHealthCheckService
and returns theUIHealthReport
when requested.But having upgraded to dotnet core 3.1, this seems to fail a new validation check, described in PR comment as "Adding breaking changes/compatibility analysis"
It lists 6 implementations of
IHostedService
that are expected, plus 4 more that are optional. If it finds any others, it throws an exception. i.e. this is now a closed system.The
AddHealthChecks()
method registers anIHostedService
called HealthCheckPublisherHostedService. It attempts to extend what is now closed, and so the validation check throws during startup.NB. If I add this cursed line of code to knock out the offending registration, it makes the validation happy:
(I have to compare the name as a string because the class is internal.) And then our
/health
function endpoint responds with healthy (2) but I don't know if it's actually doing any healthchecks anymore.Is there a "right" way to do this now? Looks like this extension now breaks some fundamental assumption recently adopted by the WebJobs/AF hosting code.
To Reproduce
Attempt to use
AddHealthChecks()
inside Azure Functions service collection registration. It throws the new validation exception during startup.Expected behavior
The healthcheck capability works, as in 2.x.
The text was updated successfully, but these errors were encountered: