BauerApps.Dataverse.Extensions.HealthChecks
1.0.0
dotnet add package BauerApps.Dataverse.Extensions.HealthChecks --version 1.0.0
NuGet\Install-Package BauerApps.Dataverse.Extensions.HealthChecks -Version 1.0.0
<PackageReference Include="BauerApps.Dataverse.Extensions.HealthChecks" Version="1.0.0" />
<PackageVersion Include="BauerApps.Dataverse.Extensions.HealthChecks" Version="1.0.0" />
<PackageReference Include="BauerApps.Dataverse.Extensions.HealthChecks" />
paket add BauerApps.Dataverse.Extensions.HealthChecks --version 1.0.0
#r "nuget: BauerApps.Dataverse.Extensions.HealthChecks, 1.0.0"
#:package BauerApps.Dataverse.Extensions.HealthChecks@1.0.0
#addin nuget:?package=BauerApps.Dataverse.Extensions.HealthChecks&version=1.0.0
#tool nuget:?package=BauerApps.Dataverse.Extensions.HealthChecks&version=1.0.0
BauerApps.Dataverse.Extensions.HealthChecks
ASP.NET Core health check for Microsoft Dataverse that verifies connectivity by executing a WhoAmI request against the registered ServiceClient.
Features
- One-line health check registration via
AddDataverseHealthCheck()onIHealthChecksBuilder - Keyed client support via
AddKeyedDataverseHealthCheck(serviceKey)for multi-environment scenarios - Returns
UserId,OrganizationId, andBusinessUnitIdin the health check result data - Uses
context.Registration.FailureStatusso consumers control whether failure isUnhealthyorDegraded - Works independently of how
ServiceClientwas registered — pairs naturally withBauerApps.Dataverse.Extensions.DependencyInjection
Get started
Install the package from NuGet:
dotnet add package BauerApps.Dataverse.Extensions.HealthChecks
Register the health check in Program.cs alongside your ServiceClient:
// Register ServiceClient (e.g. via the companion DI package)
builder.Services.AddDataverseClient(options =>
{
options.OrganizationUrl = new Uri("https://my-org.crm4.dynamics.com");
});
// Add health check
builder.Services.AddHealthChecks()
.AddDataverseHealthCheck();
Map the health check endpoint:
app.MapHealthChecks("/health");
Health check result
On success the result contains:
{
"status": "Healthy",
"description": "Dataverse connection is healthy.",
"data": {
"UserId": "a1b2c3d4-...",
"OrganizationId": "e5f6g7h8-...",
"BusinessUnitId": "i9j0k1l2-..."
}
}
On failure the result includes the exception and reports the configured failureStatus (Unhealthy by default).
Configuration options
| Parameter | Default | Description |
|---|---|---|
name |
"dataverse" |
Name shown in health reports and used for filtering. |
failureStatus |
Unhealthy |
Status to report on failure. Pass Degraded for non-critical environments. |
tags |
null |
Tags for filtering (e.g. "ready", "live"). |
timeout |
null |
Per-registration timeout. Defaults to the global health check timeout. |
Custom failure status
builder.Services.AddHealthChecks()
.AddDataverseHealthCheck(failureStatus: HealthStatus.Degraded);
Tags for liveness / readiness probes
builder.Services.AddHealthChecks()
.AddDataverseHealthCheck(tags: ["ready"]);
app.MapHealthChecks("/health/ready", new HealthCheckOptions
{
Predicate = check => check.Tags.Contains("ready")
});
Keyed clients (multiple environments)
When using keyed ServiceClient registrations, use AddKeyedDataverseHealthCheck:
builder.Services.AddDataverseClient("source", options =>
options.OrganizationUrl = new Uri("https://source.crm4.dynamics.com"));
builder.Services.AddDataverseClient("target", options =>
options.OrganizationUrl = new Uri("https://target.crm4.dynamics.com"));
builder.Services.AddHealthChecks()
.AddKeyedDataverseHealthCheck("source", name: "dataverse-source", tags: ["ready"])
.AddKeyedDataverseHealthCheck("target", name: "dataverse-target", tags: ["ready"]);
The name defaults to the serviceKey when not provided, so each keyed check appears separately in health reports.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.9)
- Microsoft.PowerPlatform.Dataverse.Client (>= 1.2.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 141 | 6/28/2026 |