ExternalServiceBuilderExtensions.WithHttpHealthCheck Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a health check to the external service resource.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ExternalServiceResource> WithHttpHealthCheck(this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ExternalServiceResource> builder, string? path = default, int? statusCode = default);
static member WithHttpHealthCheck : Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ExternalServiceResource> * string * Nullable<int> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ExternalServiceResource>
<Extension()>
Public Function WithHttpHealthCheck (builder As IResourceBuilder(Of ExternalServiceResource), Optional path As String = Nothing, Optional statusCode As Nullable(Of Integer) = Nothing) As IResourceBuilder(Of ExternalServiceResource)
Parameters
- builder
- IResourceBuilder<ExternalServiceResource>
- path
- String
The relative path to use for the HTTP health check.
Returns
Remarks
This method adds a health check to the health check service which polls the specified external service on a periodic basis. The address is based on the URL of the external service. A path for the health check request can be specified. The expected status code is set to 200 by default but a different one can be specified.