Skip to content

Latest commit

 

History

History
95 lines (61 loc) · 2.81 KB

File metadata and controls

95 lines (61 loc) · 2.81 KB

Introduction

NuGet Version

The Atc.Aspire.Hosting.Azure.Kusto package provides an Aspire Hosting Integration for running Azure Data Explorer (Kusto Emulator) containers within a .NET Aspire distributed application. It enables easy setup of Kusto instances with health checks, connection string handling, and default configurations.

Table of Content

Getting Started

Installation

Install the package via NuGet:

dotnet add package Atc.Aspire.Hosting.Azure.Kusto

Wire-Up

Register a Kusto emulator container in your AppHost's Program.cs:

var builder = DistributedApplication.CreateBuilder(args);

var kusto = builder.AddKustainer("kusto-emulator");

builder.Build().Run();

This will configure the emulator with a default HTTP port and include it in your distributed application.

If your service needs access to the emulator, reference it in your project:

var myService = builder.AddProject<Projects.MyService>().WithReference(kusto);

Your MyService project can now resolve the Kusto connection string automatically.

Configuration

Using a Custom Port

By default, the emulator runs on port 8080. You can override this by specifying a custom port:

var kusto = builder.AddKustainer("kusto-emulator", httpPort: 9090);

Configuring Data Volumes

To persist data across container restarts, you can attach a named volume:

kusto.WithDataVolume();

Alternatively, specify a custom volume name:

kusto.WithDataVolume("my-kusto-data");

HealthChecks

The emulator includes built-in health checks. These are automatically added but can be configured if needed:

builder.Services.AddHealthChecks()
    .AddCheck<KustoHealthCheck>("kusto_check");

Requirements

How to contribute

Contribution Guidelines

Coding Guidelines