Note

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

Access to this page requires authorization. You can try .

IHealthCheck.CheckHealthAsync(HealthCheckContext, CancellationToken) Method

Definition

Namespace:
Microsoft.Extensions.Diagnostics.HealthChecks
Assembly:
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.dll
Package:
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions v11.0.0-preview.5.26302.115
Source:
IHealthCheck.cs
Source:
IHealthCheck.cs
Source:
IHealthCheck.cs
Source:
IHealthCheck.cs
Source:
IHealthCheck.cs

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.

Runs the health check, returning the status of the component being checked.

public System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult> CheckHealthAsync(Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext context, System.Threading.CancellationToken cancellationToken = default);
abstract member CheckHealthAsync : Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult>
Public Function CheckHealthAsync (context As HealthCheckContext, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HealthCheckResult)

Parameters

context
HealthCheckContext

A context object associated with the current execution.

cancellationToken
CancellationToken

A CancellationToken that can be used to cancel the health check.

Returns

A Task<TResult> that completes when the health check has finished, yielding the status of the component being checked.

Exceptions

The cancellation token was canceled. This exception is stored into the returned task.

Applies to


Feedback

Was this page helpful?