Simplify health check code in .NET Aspire hosting integrations. #6283
Labels
area-app-model
Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
area-integrations
Issues pertaining to Aspire Integrations packages
Milestone
At the moment most hosting integrations are wired up to listen for the
ConnectionStringAvailableEvent
to capture the connection string and then stuff that value into a captured variable which is shared with the health check registration code. This code is overly cumbersome and we would like to improve it.The main issue is that typically most of the callbacks to configure clients on the health check registration methods are synchronous which means we can't get the connection string without doing sync over async.
We've filed this issue on the repo containing a lot of the health checks we are using:
Xabaril/AspNetCore.Diagnostics.HealthChecks#2306
That links to this PR which shows an example of the changes we are after applied to Redis:
Xabaril/AspNetCore.Diagnostics.HealthChecks#2305
The text was updated successfully, but these errors were encountered: