KustoFramework 1.1.0
dotnet add package KustoFramework --version 1.1.0
NuGet\Install-Package KustoFramework -Version 1.1.0
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="KustoFramework" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KustoFramework" Version="1.1.0" />
<PackageReference Include="KustoFramework" />
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 KustoFramework --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: KustoFramework, 1.1.0"
#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 KustoFramework@1.1.0
#: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=KustoFramework&version=1.1.0
#tool nuget:?package=KustoFramework&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
KustoFramework
A strongly-typed, LINQ-inspired query builder for Kusto Query Language (KQL), targeting .NET 10.
KustoFramework lets you build KQL queries using C# expressions — with full IntelliSense, compile-time safety, and zero runtime execution overhead.
var kql = new KustoContext()
.Table<StormEvent>()
.Where(e => e.State == "TEXAS" && e.StartTime > Kql.Ago(TimeSpan.FromDays(7)))
.Project(e => new { e.StartTime, e.EventType, e.DamageProperty })
.ToKql();
Produces:
StormEvents
| where State == "TEXAS" and StartTime > ago(7d)
| project StartTime, EventType, DamageProperty
Features
- Strongly-typed — queries are based on your C# model classes; renaming a property updates your queries at compile time
- Immutable query pipeline — each operator returns a new query, making fragments reusable and safe to share
- Rich operator support —
where,project,project-away,extend,summarize,order by,top,take,distinct,count,join,union,mv-expand,render - KQL function library — aggregations (
count(),sum(),avg(),dcount(), …), time functions (ago(),bin(),startofday(), …), string functions, type conversions, and more - Zero dependencies — pure .NET, no Kusto SDK required to build queries
Installation
dotnet add package KustoFramework
Requires .NET 10 or later.
Quick Start
1. Define your model
using KustoFramework.Attributes;
[KqlTable("StormEvents")] // optional: override the table name
public class StormEvent
{
public string State { get; set; }
public string EventType { get; set; }
public DateTime StartTime { get; set; }
public long DamageProperty { get; set; }
public int DeathsDirect { get; set; }
public int InjuriesDirect { get; set; }
}
If
[KqlTable]is omitted, the class name is used as the table name.
2. Build queries
using KustoFramework;
using KustoFramework.Extensions;
using KustoFramework.Functions;
var ctx = new KustoContext();
// Simple filter + projection
string kql = ctx.Table<StormEvent>()
.Where(e => e.DamageProperty > 0)
.Project(e => new { e.State, e.EventType, e.DamageProperty })
.ToKql();
// Aggregation
string summary = ctx.Table<StormEvent>()
.Summarize(
groupBy: e => e.State,
aggregation: e => new { Count = Kql.Count(), TotalDamage = Kql.Sum(e.DamageProperty) })
.Top(10, x => x.TotalDamage)
.ToKql();
// Reusable fragments — queries are immutable
var baseQuery = ctx.Table<StormEvent>()
.Where(e => e.StartTime > Kql.Ago(TimeSpan.FromDays(30)));
string countKql = baseQuery.Count().ToKql();
string topDamage = baseQuery.Top(5, e => e.DamageProperty).ToKql();
Documentation
Examples
- App Insights Log Viewer — A minimal CLI that queries Application Insights data from a Log Analytics workspace, demonstrating model definition, typed query building, and query execution with
KustoFramework.Azure.
Contributing
Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.
License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.