Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithHttpHealthCheck

Method
📦 Aspire.Hosting v17.0.0
func (ResourceWithEndpoints) WithHttpHealthCheck(options ...*WithHttpHealthCheckOptions) ResourceWithEndpoints

Signature

methodWithHttpHealthCheckbuilder
Adds a health check to the resource which is mapped to a specific endpoint.
WithHttpHealthCheck(options ...*WithHttpHealthCheckOptions) ResourceWithEndpoints
options...*WithHttpHealthCheckOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithHttpHealthCheckOptions argument.

Path*stringThe relative path to test.
StatusCode*float64The result code to interpret as healthy.
EndpointName*stringThe name of the endpoint to derive the base address from.
ResourceWithEndpoints

The resource builder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: