Skip to content

Latest commit

 

History

History
114 lines (83 loc) · 2.99 KB

File metadata and controls

114 lines (83 loc) · 2.99 KB

Introduction

NuGet Version

The Atc.Aspire.Azure.Kusto package provides an Aspire Client Integration for Azure Data Explorer (Kusto), wrapping the Atc.Kusto package. It simplifies integration by providing configuration-driven setup and health checks.

Table of Content

Getting Started

Installation

Install the package via NuGet:

dotnet add package Atc.Aspire.Azure.Kusto

Wire-Up

Register the Azure Data Explorer client in your Program.cs:

builder.ConfigureAzureDataExplorer("kusto");

This will configure the integration using the ConnectionStrings:kusto entry in your application configuration.

Usage

After registration, you can inject IKustoProcessor into your services:

For more information on consuming the IKustoProcessor, refer to the Atc.Kusto documentation.

public class MyService(IKustoProcessor kustoProcessor)
{
    public async Task ProcessQueryAsync()
    {
        var result = await processor.ExecuteQuery(
            new TodoQuery(),
            cancellationToken);
        Console.WriteLine(result);
    }
}

Configuration

Using a Connection String

Provide the Kusto connection string under ConnectionStrings in your configuration:

{
    "ConnectionStrings": {
        "kusto": "https://your-cluster.kusto.windows.net"
    }
}

Using Aspire Configuration

Alternatively, configure settings under the Aspire:Kusto:Client section:

{
  "Aspire": {
    "Kusto": {
      "Client": {
        "HostAddress": "https://your-cluster.kusto.windows.net",
        "DatabaseName": "MyDatabase",
        "DisableHealthChecks": false,
        "HealthCheckTimeout": 4000
      }
    }
  }
}

Inline Configuration

You can also configure settings inline when registering the service:

builder.ConfigureAzureDataExplorer("kusto", settings =>
{
    settings.DatabaseName = "MyDatabase";
});

Requirements

How to contribute

Contribution Guidelines

Coding Guidelines