AzureFunctions.TestFramework.DataExplorer
0.14.0-preview
dotnet add package AzureFunctions.TestFramework.DataExplorer --version 0.14.0-preview
NuGet\Install-Package AzureFunctions.TestFramework.DataExplorer -Version 0.14.0-preview
<PackageReference Include="AzureFunctions.TestFramework.DataExplorer" Version="0.14.0-preview" />
<PackageVersion Include="AzureFunctions.TestFramework.DataExplorer" Version="0.14.0-preview" />
<PackageReference Include="AzureFunctions.TestFramework.DataExplorer" />
paket add AzureFunctions.TestFramework.DataExplorer --version 0.14.0-preview
#r "nuget: AzureFunctions.TestFramework.DataExplorer, 0.14.0-preview"
#:package AzureFunctions.TestFramework.DataExplorer@0.14.0-preview
#addin nuget:?package=AzureFunctions.TestFramework.DataExplorer&version=0.14.0-preview&prerelease
#tool nuget:?package=AzureFunctions.TestFramework.DataExplorer&version=0.14.0-preview&prerelease
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 | Versions 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. |
-
net10.0
- AzureFunctions.TestFramework.Core (>= 0.14.0)
- Microsoft.Azure.Functions.Worker.Extensions.Kusto (>= 1.0.13-preview)
-
net8.0
- AzureFunctions.TestFramework.Core (>= 0.14.0)
- Microsoft.Azure.Functions.Worker.Extensions.Kusto (>= 1.0.13-preview)
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 |