Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AddHealthCheck

Method
📦 Aspire.Hosting v17.0.0
func (DistributedApplicationBuilder) AddHealthCheck(
name string,
check func(...any) *HealthCheckResult,
) error

Signature

methodAddHealthCheck
Adds a custom health check callback to the distributed-application builder.
AddHealthCheck(
name string,
check func(...any) *HealthCheckResult,
) error
namestringThe health check registration name.
checkfunc(...any) *HealthCheckResultcallbackThe callback that evaluates the health check.
error

Returns error.

Applies to

This method applies to the following types: