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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BauerApps.Dataverse.Extensions.HealthChecks" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BauerApps.Dataverse.Extensions.HealthChecks" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BauerApps.Dataverse.Extensions.HealthChecks" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BauerApps.Dataverse.Extensions.HealthChecks --version 1.0.0
                    
#r "nuget: BauerApps.Dataverse.Extensions.HealthChecks, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BauerApps.Dataverse.Extensions.HealthChecks@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BauerApps.Dataverse.Extensions.HealthChecks&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=BauerApps.Dataverse.Extensions.HealthChecks&version=1.0.0
                    
Install as a Cake Tool

BauerApps.Dataverse.Extensions.HealthChecks

CI NuGet NuGet Downloads License

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() on IHealthChecksBuilder
  • Keyed client support via AddKeyedDataverseHealthCheck(serviceKey) for multi-environment scenarios
  • Returns UserId, OrganizationId, and BusinessUnitId in the health check result data
  • Uses context.Registration.FailureStatus so consumers control whether failure is Unhealthy or Degraded
  • Works independently of how ServiceClient was registered — pairs naturally with BauerApps.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

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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