-
Couldn't load subscription status.
- Fork 168
Description
Description
The WithHttpsHealthCheck method has been marked as obsolete in Aspire 9.3 and will be removed in a future update.
The WithHttpHealthCheck method has been updated to default to finding and using an endpoint with an https scheme.
Version
.NET Aspire 9.3
Previous behavior
In previous releases, the WithHttpsHealthCheck method was used to register a health check for a resource that would check the status of an HTTP endpoint using a scheme of https.
The WithHttpHealthCheck method defaulted to using an endpoint named "http" if a name wasn't specified.
New behavior
The WithHttpsHealthCheck method is now obsolete. Users should use the WithHttpHealthCheck method instead.
The WithHttpHealthCheck method now defaults to using the first found endpoint with an https scheme, before falling back to the first found endpoint with an http scheme, or a specific endpoint name or selector action can be specified.
Type of breaking change
- Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
- Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
- Behavioral change: Existing binaries might behave differently at run time.
Reason for change
In Aspire 9.2, the starter template was updated to include a call to WithHttpsHealthCheck in the default case. This resulted in a behavior issue whereby if the project was then launched with the "http" launch profile, it would throw an exception during startup.
The WithHttpsHealthCheck and WithHttpHealthCheck methods were difficult to use without defensive code to first determine what kinds of endpoints were active on a resource and it's not desirable to add such code to the template. Additionally, since they were added, the WithHttpCommand method was introduced with an endpoint selection behavior that is friendlier to use, so the WithHttpHealthCheck method was updated to mimic the same behavior.
Recommended action
Remove calls to the WithHttpsHealthCheck method and replace it with calls to WithHttpHealthCheck. Verify the behavior is as expected.
Affected APIs
Aspire.Hosting.ResourceBuilderExtensions.WithHttpsHealthCheck
Aspire.Hosting.ResourceBuilderExtensions.WithHttpHealthCheck