Configure Azure Kusto Event Hub Data Connections

The azure-native:kusto:EventHubDataConnection resource, part of the Pulumi Azure Native provider, defines the connection between an Event Hub and a Kusto database, controlling how streaming data flows into Azure Data Explorer tables. This guide focuses on three capabilities: Event Hub source configuration, managed identity authentication, and table and data format mapping.

Data connections belong to Kusto databases and reference Event Hub resources, consumer groups, and managed identities that must exist separately. The examples are intentionally small. Combine them with your own Kusto clusters, Event Hub infrastructure, and authentication configuration.

Create a minimal data connection with required properties

The simplest configuration establishes the data connection resource by specifying the cluster, database, and connection name.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const eventHubDataConnection = new azure_native.kusto.EventHubDataConnection("eventHubDataConnection", {
    clusterName: "kustoCluster",
    dataConnectionName: "dataConnectionTest",
    databaseName: "KustoDatabase1",
    resourceGroupName: "kustorptest",
});
import pulumi
import pulumi_azure_native as azure_native

event_hub_data_connection = azure_native.kusto.EventHubDataConnection("eventHubDataConnection",
    cluster_name="kustoCluster",
    data_connection_name="dataConnectionTest",
    database_name="KustoDatabase1",
    resource_group_name="kustorptest")
package main

import (
	kusto "github.com/pulumi/pulumi-azure-native-sdk/kusto/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kusto.NewEventHubDataConnection(ctx, "eventHubDataConnection", &kusto.EventHubDataConnectionArgs{
			ClusterName:        pulumi.String("kustoCluster"),
			DataConnectionName: pulumi.String("dataConnectionTest"),
			DatabaseName:       pulumi.String("KustoDatabase1"),
			ResourceGroupName:  pulumi.String("kustorptest"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var eventHubDataConnection = new AzureNative.Kusto.EventHubDataConnection("eventHubDataConnection", new()
    {
        ClusterName = "kustoCluster",
        DataConnectionName = "dataConnectionTest",
        DatabaseName = "KustoDatabase1",
        ResourceGroupName = "kustorptest",
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.kusto.EventHubDataConnection;
import com.pulumi.azurenative.kusto.EventHubDataConnectionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var eventHubDataConnection = new EventHubDataConnection("eventHubDataConnection", EventHubDataConnectionArgs.builder()
            .clusterName("kustoCluster")
            .dataConnectionName("dataConnectionTest")
            .databaseName("KustoDatabase1")
            .resourceGroupName("kustorptest")
            .build());

    }
}
resources:
  eventHubDataConnection:
    type: azure-native:kusto:EventHubDataConnection
    properties:
      clusterName: kustoCluster
      dataConnectionName: dataConnectionTest
      databaseName: KustoDatabase1
      resourceGroupName: kustorptest

This creates the connection resource without configuring Event Hub ingestion details. The clusterName and databaseName identify where the connection lives within your Kusto infrastructure. The dataConnectionName provides a unique identifier for this specific connection. You’ll add Event Hub source configuration separately.

Stream Event Hub data into Kusto with managed identity

Analytics pipelines continuously ingest Event Hub streams into Kusto tables for real-time querying.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const eventHubDataConnection = new azure_native.kusto.EventHubDataConnection("eventHubDataConnection", {
    clusterName: "kustoCluster",
    consumerGroup: "testConsumerGroup1",
    dataConnectionName: "dataConnectionTest",
    databaseName: "KustoDatabase8",
    eventHubResourceId: "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1",
    kind: "EventHub",
    location: "westus",
    managedIdentityResourceId: "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1",
    resourceGroupName: "kustorptest",
});
import pulumi
import pulumi_azure_native as azure_native

event_hub_data_connection = azure_native.kusto.EventHubDataConnection("eventHubDataConnection",
    cluster_name="kustoCluster",
    consumer_group="testConsumerGroup1",
    data_connection_name="dataConnectionTest",
    database_name="KustoDatabase8",
    event_hub_resource_id="/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1",
    kind="EventHub",
    location="westus",
    managed_identity_resource_id="/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1",
    resource_group_name="kustorptest")
package main

import (
	kusto "github.com/pulumi/pulumi-azure-native-sdk/kusto/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kusto.NewEventHubDataConnection(ctx, "eventHubDataConnection", &kusto.EventHubDataConnectionArgs{
			ClusterName:               pulumi.String("kustoCluster"),
			ConsumerGroup:             pulumi.String("testConsumerGroup1"),
			DataConnectionName:        pulumi.String("dataConnectionTest"),
			DatabaseName:              pulumi.String("KustoDatabase8"),
			EventHubResourceId:        pulumi.String("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"),
			Kind:                      pulumi.String("EventHub"),
			Location:                  pulumi.String("westus"),
			ManagedIdentityResourceId: pulumi.String("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"),
			ResourceGroupName:         pulumi.String("kustorptest"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var eventHubDataConnection = new AzureNative.Kusto.EventHubDataConnection("eventHubDataConnection", new()
    {
        ClusterName = "kustoCluster",
        ConsumerGroup = "testConsumerGroup1",
        DataConnectionName = "dataConnectionTest",
        DatabaseName = "KustoDatabase8",
        EventHubResourceId = "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1",
        Kind = "EventHub",
        Location = "westus",
        ManagedIdentityResourceId = "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1",
        ResourceGroupName = "kustorptest",
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.kusto.EventHubDataConnection;
import com.pulumi.azurenative.kusto.EventHubDataConnectionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var eventHubDataConnection = new EventHubDataConnection("eventHubDataConnection", EventHubDataConnectionArgs.builder()
            .clusterName("kustoCluster")
            .consumerGroup("testConsumerGroup1")
            .dataConnectionName("dataConnectionTest")
            .databaseName("KustoDatabase8")
            .eventHubResourceId("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1")
            .kind("EventHub")
            .location("westus")
            .managedIdentityResourceId("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1")
            .resourceGroupName("kustorptest")
            .build());

    }
}
resources:
  eventHubDataConnection:
    type: azure-native:kusto:EventHubDataConnection
    properties:
      clusterName: kustoCluster
      consumerGroup: testConsumerGroup1
      dataConnectionName: dataConnectionTest
      databaseName: KustoDatabase8
      eventHubResourceId: /subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1
      kind: EventHub
      location: westus
      managedIdentityResourceId: /subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1
      resourceGroupName: kustorptest

The eventHubResourceId points to your Event Hub, and consumerGroup specifies which consumer group reads the stream. The managedIdentityResourceId enables authentication without storing credentials. At runtime, Kusto reads events from the consumer group, applies the optional mappingRuleName transformation, and writes to the tableName. The dataFormat property tells Kusto how to parse incoming messages (JSON, CSV, Avro, etc.).

Beyond these examples

These snippets focus on specific data connection features: Event Hub ingestion with managed identity authentication, and table routing and data format specification. They’re intentionally minimal rather than full ingestion pipelines.

The examples reference pre-existing infrastructure such as Kusto clusters and databases, Event Hub namespaces and consumer groups, and managed identities for authentication. They focus on configuring the data connection rather than provisioning the surrounding infrastructure.

To keep things focused, common data connection patterns are omitted, including:

  • Compression settings for Event Hub messages
  • Historical data retrieval (retrievalStartDate)
  • Event system properties filtering
  • Database routing configuration (databaseRouting)

These omissions are intentional: the goal is to illustrate how each data connection feature is wired, not provide drop-in ingestion modules. See the EventHubDataConnection resource reference for all available configuration options.

Let's configure Azure Kusto Event Hub Data Connections

Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.

Try Pulumi Cloud for FREE

Frequently Asked Questions

Resource Configuration & Lifecycle
What properties can't I change after creating the data connection?
The clusterName, dataConnectionName, databaseName, and resourceGroupName properties are immutable. Changing any of these forces resource replacement.
What's the minimum configuration needed to create an Event Hub data connection?
You need clusterName, dataConnectionName, databaseName, resourceGroupName, consumerGroup, eventHubResourceId, and kind (set to EventHub).
Data Ingestion & Routing
Can I specify data format, mapping rules, or table name per message instead of at the connection level?
Yes. The dataFormat, mappingRuleName, and tableName properties are optional at the connection level and can be added to individual messages instead.
Can I ingest historical Event Hub events?
Yes. Set retrievalStartDate to retrieve existing Event Hub events created since that date. You can only retrieve events retained by the Event Hub based on its retention period.
Authentication & Identity
How do I authenticate the data connection with Event Hub?
Use managedIdentityResourceId to specify a managed identity (system or user assigned) for authentication with Event Hub.
What is managedIdentityObjectId and how is it set?
managedIdentityObjectId is a computed output property that contains the object ID of the managed identity specified in managedIdentityResourceId. You cannot set it directly.

Using a different cloud?

Explore analytics guides for other cloud providers: