Azure Data Explorer
Description
Azure Data Explorer (Kusto) can be used as the backing implementation for Flex time-series operations. Your application code should depend on IFlexTimeSeriesStore, while Flex provides the provider bridge and wiring.
Important concepts
IFlexTimeSeriesStoreis the contract: app code writes and queries time-series data via a shared interface.Write + query patterns: generated handlers typically call
WriteAsync<TPoint>(point), and generated queries useGetLatestAsync<TPoint>(seriesId)/QueryAsync<TPoint>(seriesId, start, end).Provider bridge: the Azure Data Explorer implementation is exposed via an
IFlexTimeSeriesStoreBridgeinternally, but most consumers only needIFlexTimeSeriesStore.
Configuration in DI
Add the provider in your DI composition root (commonly in EndPoints/...CommonConfigs/OtherApplicationServicesConfig.cs or wherever you centralize registrations).
// using Sumeru.Flex; // IFlexTimeSeriesStore
public static class OtherApplicationServicesConfig
{
public static IServiceCollection AddOtherApplicationServices(
this IServiceCollection services,
IConfiguration configuration)
{
// Registers Azure Data Explorer as the IFlexTimeSeriesStore bridge.
// Flex auto-wires generated Queries/Handlers that *use* IFlexTimeSeriesStore.
services.AddFlexAzureDataExplorerTimeSeriesStore(configuration);
return services;
}
}appsettings.json
Configuration is read from FlexBase:DataStores:TimeSeries:AzureDataExplorer.
Examples (template-based)
These examples mirror the generated Query and PostBusHandler templates. You do not register these types manually—Flex discovers and wires generated Queries/Handlers automatically.
Write a data point (PostBusHandler)
Get the latest point (Query)
Azure Data Explorer considerations
ClusterUriandDatabaseare required for cluster mode.If you need custom authentication behavior (managed identity vs app registration), handle it via environment/Azure identity configuration or by overriding the generated bridge in your application.
Last updated