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 & Immutability
What properties can't I change after creating the data connection?
Four properties are immutable: clusterName, dataConnectionName, databaseName, and resourceGroupName. Changing any of these requires recreating the resource.
What's required to create an Event Hub data connection?
You must provide clusterName, databaseName, resourceGroupName, dataConnectionName, consumerGroup, eventHubResourceId, and set kind to EventHub.
Authentication & Identity
How do I authenticate the data connection with Event Hub?
Use managedIdentityResourceId to specify a system-assigned or user-assigned managed identity for authentication. The output property managedIdentityObjectId will contain the object ID of this identity.
Data Ingestion & Routing
Can I specify the table and data format per message instead of at the connection level?
Yes. The tableName, dataFormat, and mappingRuleName properties are optional at the connection level because you can add this information to each message individually.
What does the databaseRouting property control?
databaseRouting controls how database routing information flows from the data connection. It defaults to Single, meaning only database routing information is allowed.
Historical Data & Retrieval
Can I ingest historical events from Event Hub?
Yes. Set retrievalStartDate to retrieve existing Event Hub events created since that date. You can only retrieve events still retained by Event Hub based on its retention period.

Using a different cloud?

Explore analytics guides for other cloud providers: