Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

HealthCheckApplicationBuilderExtensions.UseHealthChecks Method

Definition

Namespace:
Microsoft.AspNetCore.Builder
Assembly:
Microsoft.AspNetCore.Diagnostics.HealthChecks.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Diagnostics.HealthChecks v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8

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.

Overloads

Name Description
UseHealthChecks(IApplicationBuilder, PathString)

Adds a middleware that provides health check status.

UseHealthChecks(IApplicationBuilder, PathString, HealthCheckOptions)

Adds a middleware that provides health check status.

UseHealthChecks(IApplicationBuilder, PathString, Int32)

Adds a middleware that provides health check status.

UseHealthChecks(IApplicationBuilder, PathString, String)

Adds a middleware that provides health check status.

UseHealthChecks(IApplicationBuilder, PathString, Int32, HealthCheckOptions)

Adds a middleware that provides health check status.

UseHealthChecks(IApplicationBuilder, PathString, String, HealthCheckOptions)

Adds a middleware that provides health check status.

UseHealthChecks(IApplicationBuilder, PathString)

Source:
HealthCheckApplicationBuilderExtensions.cs
Source:
HealthCheckApplicationBuilderExtensions.cs

Adds a middleware that provides health check status.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseHealthChecks(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Http::PathString path);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseHealthChecks(this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Http.PathString path);
static member UseHealthChecks : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Http.PathString -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseHealthChecks (app As IApplicationBuilder, path As PathString) As IApplicationBuilder

Parameters

path
PathString

The path on which to provide health check status.

Returns

A reference to the app after the operation has completed.

Remarks

If path is set to null or the empty string then the health check middleware will ignore the URL path and process all requests. If path is set to a non-empty value, the health check middleware will process requests with a URL that matches the provided value of path case-insensitively, allowing for an extra trailing slash ('/') character.

The health check middleware will use default settings from IOptions<TOptions>.

Applies to

UseHealthChecks(IApplicationBuilder, PathString, HealthCheckOptions)

Source:
HealthCheckApplicationBuilderExtensions.cs
Source:
HealthCheckApplicationBuilderExtensions.cs

Adds a middleware that provides health check status.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseHealthChecks(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Http::PathString path, Microsoft::AspNetCore::Diagnostics::HealthChecks::HealthCheckOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseHealthChecks(this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Http.PathString path, Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckOptions options);
static member UseHealthChecks : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseHealthChecks (app As IApplicationBuilder, path As PathString, options As HealthCheckOptions) As IApplicationBuilder

Parameters

path
PathString

The path on which to provide health check status.

options
HealthCheckOptions

A HealthCheckOptions used to configure the middleware.

Returns

A reference to the app after the operation has completed.

Remarks

If path is set to null or the empty string then the health check middleware will ignore the URL path and process all requests. If path is set to a non-empty value, the health check middleware will process requests with a URL that matches the provided value of path case-insensitively, allowing for an extra trailing slash ('/') character.

Applies to

UseHealthChecks(IApplicationBuilder, PathString, Int32)

Source:
HealthCheckApplicationBuilderExtensions.cs
Source:
HealthCheckApplicationBuilderExtensions.cs

Adds a middleware that provides health check status.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseHealthChecks(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Http::PathString path, int port);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseHealthChecks(this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Http.PathString path, int port);
static member UseHealthChecks : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Http.PathString * int -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseHealthChecks (app As IApplicationBuilder, path As PathString, port As Integer) As IApplicationBuilder

Parameters

path
PathString

The path on which to provide health check status.

port
Int32

The port to listen on. Must be a local port on which the server is listening.

Returns

A reference to the app after the operation has completed.

Remarks

If path is set to null or the empty string then the health check middleware will ignore the URL path and process all requests on the specified port. If path is set to a non-empty value, the health check middleware will process requests with a URL that matches the provided value of path case-insensitively, allowing for an extra trailing slash ('/') character.

The health check middleware will use default settings from IOptions<TOptions>.

Applies to

UseHealthChecks(IApplicationBuilder, PathString, String)

Source:
HealthCheckApplicationBuilderExtensions.cs
Source:
HealthCheckApplicationBuilderExtensions.cs

Adds a middleware that provides health check status.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseHealthChecks(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Http::PathString path, System::String ^ port);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseHealthChecks(this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Http.PathString path, string port);
static member UseHealthChecks : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Http.PathString * string -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseHealthChecks (app As IApplicationBuilder, path As PathString, port As String) As IApplicationBuilder

Parameters

path
PathString

The path on which to provide health check status.

port
String

The port to listen on. Must be a local port on which the server is listening.

Returns

A reference to the app after the operation has completed.

Remarks

If path is set to null or the empty string then the health check middleware will ignore the URL path and process all requests on the specified port. If path is set to a non-empty value, the health check middleware will process requests with a URL that matches the provided value of path case-insensitively, allowing for an extra trailing slash ('/') character.

The health check middleware will use default settings from IOptions<TOptions>.

Applies to

UseHealthChecks(IApplicationBuilder, PathString, Int32, HealthCheckOptions)

Source:
HealthCheckApplicationBuilderExtensions.cs
Source:
HealthCheckApplicationBuilderExtensions.cs

Adds a middleware that provides health check status.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseHealthChecks(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Http::PathString path, int port, Microsoft::AspNetCore::Diagnostics::HealthChecks::HealthCheckOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseHealthChecks(this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Http.PathString path, int port, Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckOptions options);
static member UseHealthChecks : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Http.PathString * int * Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseHealthChecks (app As IApplicationBuilder, path As PathString, port As Integer, options As HealthCheckOptions) As IApplicationBuilder

Parameters

path
PathString

The path on which to provide health check status.

port
Int32

The port to listen on. Must be a local port on which the server is listening.

options
HealthCheckOptions

A HealthCheckOptions used to configure the middleware.

Returns

A reference to the app after the operation has completed.

Remarks

If path is set to null or the empty string then the health check middleware will ignore the URL path and process all requests on the specified port. If path is set to a non-empty value, the health check middleware will process requests with a URL that matches the provided value of path case-insensitively, allowing for an extra trailing slash ('/') character.

Applies to

UseHealthChecks(IApplicationBuilder, PathString, String, HealthCheckOptions)

Source:
HealthCheckApplicationBuilderExtensions.cs
Source:
HealthCheckApplicationBuilderExtensions.cs

Adds a middleware that provides health check status.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseHealthChecks(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Http::PathString path, System::String ^ port, Microsoft::AspNetCore::Diagnostics::HealthChecks::HealthCheckOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseHealthChecks(this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Http.PathString path, string port, Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckOptions options);
static member UseHealthChecks : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Http.PathString * string * Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseHealthChecks (app As IApplicationBuilder, path As PathString, port As String, options As HealthCheckOptions) As IApplicationBuilder

Parameters

path
PathString

The path on which to provide health check status.

port
String

The port to listen on. Must be a local port on which the server is listening.

options
HealthCheckOptions

A HealthCheckOptions used to configure the middleware.

Returns

A reference to the app after the operation has completed.

Remarks

If path is set to null or the empty string then the health check middleware will ignore the URL path and process all requests on the specified port. If path is set to a non-empty value, the health check middleware will process requests with a URL that matches the provided value of path case-insensitively, allowing for an extra trailing slash ('/') character.

Applies to


Feedback

Was this page helpful?