AzureFunctions.TestFramework.DataExplorer 0.14.0-preview

This is a prerelease version of AzureFunctions.TestFramework.DataExplorer.
dotnet add package AzureFunctions.TestFramework.DataExplorer --version 0.14.0-preview
                    
NuGet\Install-Package AzureFunctions.TestFramework.DataExplorer -Version 0.14.0-preview
                    
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="AzureFunctions.TestFramework.DataExplorer" Version="0.14.0-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AzureFunctions.TestFramework.DataExplorer" Version="0.14.0-preview" />
                    
Directory.Packages.props
<PackageReference Include="AzureFunctions.TestFramework.DataExplorer" />
                    
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 AzureFunctions.TestFramework.DataExplorer --version 0.14.0-preview
                    
#r "nuget: AzureFunctions.TestFramework.DataExplorer, 0.14.0-preview"
                    
#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 AzureFunctions.TestFramework.DataExplorer@0.14.0-preview
                    
#: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=AzureFunctions.TestFramework.DataExplorer&version=0.14.0-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AzureFunctions.TestFramework.DataExplorer&version=0.14.0-preview&prerelease
                    
Install as a Cake Tool

AzureFunctions.TestFramework.DataExplorer

Azure Data Explorer (Kusto) Input and Output binding support for the Azure Functions Test Framework.

Installation

dotnet add package AzureFunctions.TestFramework.DataExplorer

Supported bindings

Binding Attribute Description
[KustoInput] Input Reads rows from an Azure Data Explorer query result
[KustoOutput] Output Ingests rows into an Azure Data Explorer table — captured via FunctionInvocationResult

ℹ️ Azure Data Explorer has no trigger binding in the isolated worker extension. Use another trigger type (for example Queue, Timer, or HTTP) and assert Kusto input/output behavior in that invocation.

Kusto Input Binding

Register fake rows via the builder so they are injected automatically for every invocation:

var host = await new FunctionsTestHostBuilder()
    .WithFunctionsAssembly(typeof(MyFunction).Assembly)
    .WithHostBuilderFactory(Program.CreateHostBuilder)
    // Inject rows for [KustoInput("MyDb", KqlCommand = "InputTable | take 10")]
    .WithKustoInputRows(
        database: "MyDb",
        table: "InputTable",
        rows:
        [
            new Product { Id = 1, Name = "Widget" },
            new Product { Id = 2, Name = "Gadget" }
        ])
    .BuildAndStartAsync();

Use WithKustoInputRows<T>(database, table, T row) to inject a single row, WithKustoInputRows<T>(database, table, IReadOnlyList<T> rows) to inject multiple rows, and WithKustoInputJson(database, table, json) to inject raw JSON.

Function example

[Function("ReadKustoProducts")]
public void Run(
    [QueueTrigger("kusto-input-queue")] string queueMessage,
    [KustoInput("MyDb", KqlCommand = "InputTable | take 10")] IReadOnlyList<Product> products)
{
    foreach (var product in products)
        _logger.LogInformation("Product: {Name}", product.Name);
}

Kusto Output Binding

Output bindings are captured automatically via FunctionInvocationResult:

var result = await host.InvokeQueueAsync("WriteKustoOutput", "source");

Assert.True(result.Success);
var written = result.ReadReturnValueAs<Product>();
Assert.Equal("copy:source", written?.Name);

Function example

[Function("WriteKustoOutput")]
[KustoOutput("MyDb", TableName = "OutputTable")]
public Product Run([QueueTrigger("kusto-output-queue")] string message)
{
    return new Product { Id = 1, Name = $"copy:{message}" };
}

Known limitation

WithKustoInputRows(database, table, ...) matches by database and the first table identifier in KqlCommand (for example "InputTable | take 10"). If your query starts with declare statements or does not begin with a table identifier, use WithKustoInputJson(...) with a matching database/table registration strategy in your tests.

Testing across all four flavours

Add the Data Explorer package reference to your test project and all four function-app test flavours:

<PackageReference Include="AzureFunctions.TestFramework.DataExplorer" />

See the 4-flavour matrix test pattern for the concrete test class structure.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
0.14.0-preview 52 5/25/2026