Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 18, 2025

This PR adds a new health check package NetEvolve.HealthChecks.Azure.Kusto for monitoring Azure Kusto (Data Explorer) clusters and databases.

Features

The new package provides comprehensive health checks for Azure Kusto with the following capabilities:

  • Cluster connectivity verification - Executes .show cluster command to verify cluster availability
  • Optional database validation - When DatabaseName is specified, verifies the database exists using .show databases
  • Multiple authentication modes:
    • ConnectionString - Direct connection string authentication (default)
    • DefaultAzureCredentials - Azure AD authentication with default credentials
    • ServiceProvider - Use pre-registered ICslQueryProvider from DI container
  • Configurable timeouts - Default 100ms with support for custom timeout values
  • Comprehensive validation - Input validation for all configuration modes

Usage Examples

Configuration-based approach

{
  "HealthChecks": {
    "AzureKusto": {
      "MyCluster": {
        "ConnectionString": "Data Source=https://mycluster.kusto.windows.net;Initial Catalog=MyDatabase;AAD Federated Security=True",
        "DatabaseName": "MyDatabase",
        "Timeout": 5000
      }
    }
  }
}
builder.Services.AddHealthChecks()
    .AddKusto("MyCluster");

Options-based approach

builder.Services.AddHealthChecks()
    .AddKusto("MyCluster", options =>
    {
        options.ConnectionString = "Data Source=https://mycluster.kusto.windows.net;...";
        options.DatabaseName = "MyDatabase"; // Optional
        options.Timeout = 5000;
    });

Implementation Details

The implementation follows the established patterns used by other Azure health check packages in this repository:

  • Uses ConfigurableHealthCheckBase<T> from NetEvolve.HealthChecks.Abstractions
  • Implements client caching via ClientCreation class
  • Provides comprehensive options validation through KustoConfigure
  • Includes proper dependency injection setup with DependencyInjectionExtensions
  • Uses Microsoft.Azure.Kusto.Data package for Kusto client operations
  • Supports both .NET 8.0 and .NET 9.0 target frameworks

The health check executes lightweight Kusto management commands (.show cluster and optionally .show databases) to verify connectivity and database availability without impacting cluster performance.

Files Added

  • src/NetEvolve.HealthChecks.Azure.Kusto/ - Complete package implementation
  • Updated src/NetEvolve.HealthChecks.Azure/ bundle package to include Kusto
  • Updated src/NetEvolve.HealthChecks.Azure/README.md to list Kusto support
  • Basic unit tests in tests/NetEvolve.HealthChecks.Tests.Unit/Azure.Kusto/
  • Added Microsoft.Azure.Kusto.Data package reference to central package management

Fixes #733.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • aka.ms
    • Triggering command: curl -I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] NetEvolve.HealthChecks.Azure.Kusto Add NetEvolve.HealthChecks.Azure.Kusto package for Azure Data Explorer health checks Aug 18, 2025
@Copilot Copilot AI requested a review from samtrion August 18, 2025 20:54
Copilot finished work on behalf of samtrion August 18, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NetEvolve.HealthChecks.Azure.Kusto
2 participants