You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-operations/discover-manage-assets/howto-connect-kafka.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,14 @@ author: dominicbetts
5
5
ms.author: dobett
6
6
ms.service: azure-iot-operations
7
7
ms.topic: how-to
8
-
ms.date: 02/19/2026
8
+
ms.date: 02/23/2026
9
9
10
10
#CustomerIntent: As an industrial edge IT or operations user, I want to ingest data from an Azure Event Hubs namespace into Azure IoT Operations using the Kafka protocol so that I can manage event hubs as assets and route the data through the MQTT broker for processing.
11
11
---
12
12
13
13
# Connect to a Kafka source
14
14
15
-
Many messaging services expose a Kafka-compatible endpoint, including Azure Event Hubs, Confluent Cloud, and self-hosted Apache Kafka clusters. Azure IoT Operations doesn't include a dedicated Kafka connector, but you can ingest data from any Kafka-compatible source by combining two components. For simplicity, this article uses an Azure Event Hubs namespace as the Kafka source.
15
+
Many messaging services expose a Kafka-compatible endpoint, including Azure Event Hubs, Confluent Cloud, and self-hosted Apache Kafka clusters. Azure IoT Operations doesn't include a dedicated southbound Kafka connector, but you can ingest data from any Kafka-compatible source by using a data flow and the connector for MQTT (preview). For simplicity, this article uses an Azure Event Hubs namespace as the Kafka source.
16
16
17
17
To connect to a Kafka source, you combine:
18
18
@@ -22,9 +22,9 @@ To connect to a Kafka source, you combine:
22
22
23
23
The following diagram illustrates this architecture:
24
24
25
-
:::image type="content" source="media/howto-connect-kafka/kafka.png" alt-text="Diagram that shows the architecture of the solution.":::
25
+
:::image type="content" source="media/howto-connect-kafka/kafka.svg" alt-text="Diagram that shows the architecture of the solution." lightbox="media/howto-connect-kafka/kafka.png":::
26
26
27
-
Messages enter from the Kafka source, such as an Azure Event Hubs namespace, and are ingested into Azure IoT Operations through a data flow with a Kafka source endpoint. The data flow routes messages to topics in the internal MQTT broker. The connector for MQTT (preview) detects the topics in the MQTT broker and creates assets based on the topic names. Each asset can be configured to route data to specific topics in the MQTT broker and apply custom processing.
27
+
Messages enter from the Kafka source, such as an Azure Event Hubs namespace, and are ingested into Azure IoT Operations through a data flow with a Kafka source endpoint. The data flow routes messages to topics in the internal MQTT broker. The connector for MQTT (preview) detects the topics in the MQTT broker and lets you create assets based on the topic names. Each asset can be configured to route data to specific topics in the MQTT broker. You can then perform any routing and custom processing to the messages.
28
28
29
29
30
30
> [!TIP]
@@ -33,9 +33,9 @@ Messages enter from the Kafka source, such as an Azure Event Hubs namespace, and
33
33
## Prerequisites
34
34
35
35
- A running instance of Azure IoT Operations with the MQTT broker enabled.
36
-
- An Azure Event Hubs namespace with one or more event hubs that contain the data you want to ingest. Event Hubs exposes a Kafka-compatible endpoint at `<namespace>.servicebus.windows.net:9093`. For more information, see [Use Azure Event Hubs from Apache Kafka applications](/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview).
36
+
- An Azure Event Hubs namespace with one or more event hubs that contain the data you want to ingest. Event Hubs exposes a Kafka-compatible endpoint at `<namespace>.servicebus.windows.net:9093`. For more information, see [Use Azure Event Hubs from Apache Kafka applications](/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview). This article uses a set of four event hubs called `factory-f1-robot-r1`, `warehouse-w1-machine-m1`, `warehouse-w1-machine-m2`, and `warehouse-w1-machine-m3` for the examples, but you can use any number of event hubs with your own naming convention.
37
37
- The user-assigned managed identity for your Azure IoT Operations instance must be assigned the **Azure Event Hubs Data Receiver** role on the Event Hubs namespace. For more information, see [Assign Azure roles using the Azure portal](/azure/role-based-access-control/role-assignments-portal).
38
-
- The MQTT connector template configured for your Azure IoT Operations instance in the Azure portal. Contact your IT administrator to complete this step.
38
+
- The [MQTT connector template](howto-use-mqtt-connector.md#deploy-the-connector-for-mqtt) configured for your Azure IoT Operations instance in the Azure portal. Contact your IT administrator to complete this step.
@@ -49,8 +49,8 @@ Before you create a data flow, you must create a **data flow endpoint** that hol
49
49
50
50
| Setting | Example value | Description |
51
51
|---------|---------------|-------------|
52
-
| Name |`contoso-eventhubs`| A name for the data flow endpoint. |
53
-
| Host |`contoso-namespace.servicebus.windows.net`| The hostname of the Event Hubs namespace. |
52
+
| Name |`my-kafka-ep`| A name for the data flow endpoint. |
53
+
| Host |`mykafkasource.servicebus.windows.net`| The hostname of the Event Hubs namespace. |
54
54
| Port |`9093`| The port for the Kafka-compatible Event Hubs endpoint. |
55
55
| Authentication method | User assigned managed identity | Use the user-assigned managed identity configured for Azure IoT Operations cloud connections. |
56
56
@@ -70,7 +70,7 @@ Create a data flow that reads from your Event Hubs namespace using the Kafka pro
70
70
71
71
| Setting | Example value |
72
72
|---------|---------------|
73
-
| Endpoint |`contoso-eventhubs`|
73
+
| Endpoint |`my-kafka-ep`|
74
74
| Topic |`^(warehouse-w1-.*\|factory-f1-.*)$`|
75
75
| Consumer group |`aio-eventhubs-ingest`|
76
76
@@ -80,12 +80,14 @@ Create a data flow that reads from your Event Hubs namespace using the Kafka pro
80
80
81
81
Select **Next** to continue.
82
82
83
-
1. On the **Destination** page, select **MQTT broker** as the destination. Set the destination topic to `factory/${inputTopic}`. This expression uses the name of the source Kafka topic as the final segment of the MQTT topic path, so messages from each event hub land under the `factory/` prefix — for example, messages from `factory-f1-robot-r1` are routed to `factory/factory-f1-robot-r1`.
83
+
1. On the **Destination** page, select **MQTT broker** as the destination. Set the destination topic to `factory/${inputTopic}`. This expression uses the name of the source Kafka topic as the final segment of the MQTT topic path, so messages from each event hub land under the `factory/` prefix — for example, messages from `factory-f1-robot-r1` are routed to the `factory/factory-f1-robot-r1` topic.
84
84
85
85
:::image type="content" source="media/howto-connect-kafka/dataflow-destination-mqtt.png" alt-text="Screenshot that shows the MQTT broker destination configuration with the source topic name option enabled." lightbox="media/howto-connect-kafka/dataflow-destination-mqtt.png":::
86
86
87
87
Select **Next** to continue.
88
88
89
+
1. Optionally, configure any transformations or filters on the data.
90
+
89
91
1. On the **Summary** page, review the data flow configuration and select **Create** to create the data flow.
90
92
91
93
Once the data flow is running, messages from your Event Hubs topics appear in the MQTT broker under the `factory/` topic prefix.
@@ -96,7 +98,7 @@ Set up a device in the connector for MQTT (preview) that subscribes to the MQTT
96
98
97
99
1. In the operations experience web UI, select **Devices** in the left navigation pane. Then select **Create new**.
98
100
99
-
1. Enter a name for the device, such as `kafka-source`. To add the inbound endpoint, select **New** on the **Microsoft.Mqtt** tile.
101
+
1. Enter a name for the device, such as `kafka-incoming`. To add the inbound endpoint, select **New** on the **Microsoft.Mqtt** tile.
100
102
101
103
1. On the **Basic** page, set the URL to the internal MQTT broker address. The data flow routes incoming messages to topics under the `factory/` prefix, such as `factory/factory-f1-robot-r1` and `factory/warehouse-w1-machine-m1`. Enter `mqtt://aio-broker:1883` as the URL.
102
104
@@ -120,7 +122,7 @@ Set up a device in the connector for MQTT (preview) that subscribes to the MQTT
120
122
121
123
Before you can discover assets, messages must arrive at the MQTT broker so the connector for MQTT (preview) can detect the topics. You can use the **Data Explorer** feature built into each event hub in the Azure portal to send test messages.
122
124
123
-
1. In the [Azure portal](https://portal.azure.com), navigate to your Event Hubs namespace, then select the event hub you want to test, such as `factory-f1-robot-r1`.
125
+
1. In the [Azure portal](https://portal.azure.com), navigate to your Event Hubs namespace, then select the event hub you want to test, such as `warehouse-w1-machine-m1`.
124
126
125
127
1. In the left navigation pane for the event hub, select **Data Explorer (preview)**.
126
128
@@ -142,7 +144,10 @@ When the data flow forwards Event Hubs messages to the MQTT broker, the connecto
142
144
143
145
:::image type="content" source="media/howto-connect-kafka/detected-assets.png" alt-text="Screenshot that shows the list of discovered assets from the Kafka topics." lightbox="media/howto-connect-kafka/detected-assets.png":::
144
146
145
-
1. Make a note of the discovered asset name. Select the discovered asset and then select **Import and create asset**.
147
+
> [!TIP]
148
+
> The name of the discovered asset is determined by the topic path and the asset level you set in the device endpoint configuration. The connector adds a random suffix to the asset name to ensure uniqueness.
149
+
150
+
1. Make a note of the full discovered asset name including the suffix. Select the discovered asset and then select **Import and create asset**.
146
151
147
152
1. On the **Asset details** page, the inbound endpoint is already selected from the device. Currently, you must use the name of the discovered asset as the asset name. Add a description, and any custom properties you want. Then select **Next**.
148
153
@@ -153,7 +158,7 @@ When the data flow forwards Event Hubs messages to the MQTT broker, the connecto
153
158
154
159
:::image type="content" source="media/howto-connect-kafka/asset-dataset.png" alt-text="Screenshot that shows the dataset created automatically from the detected Kafka asset." lightbox="media/howto-connect-kafka/asset-dataset.png":::
155
160
156
-
You can also add more datasets to capture messages from other related topics, or configure data processing such as filtering or transformation on the outgoing data. Select **Next** to continue.
161
+
You can also add more datasets to capture messages from other related topics. Select **Next** to continue.
157
162
158
163
1. On the review page, select **Create** to create the asset. After a few minutes, the asset appears in the **Assets** list.
Copy file name to clipboardExpand all lines: articles/iot-operations/discover-manage-assets/overview-manage-assets.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,8 @@ Akri services let you deploy and set up connectivity protocols at the edge. Akri
132
132
- The **connector for ONVIF** is a service that discovers and registers ONVIF assets like cameras. The connector lets you manage and control ONVIF assets like cameras connected to your cluster.
133
133
- The **connector for HTTP/REST** is a service that lets you connect to HTTP/REST endpoints and publish data to the MQTT broker.
134
134
- The **connector for SSE** is a service that lets you connect to SSE endpoints and publish event data to the MQTT broker.
135
+
- The **connector for MQTT (preview)** is a service that lets you subscribe to topics on MQTT brokers and publish data to the Azure IoT Operations MQTT broker. This connector is designed for connecting to other MQTT brokers in your environment.
136
+
- You can also use a data flow to connect to a Kafka endpoint and route messages to the MQTT broker. Learn how in [Connect to Kafka endpoints](howto-connect-kafka.md).
135
137
-**Custom connectors** are services that you create to connect to other data sources and publish data to the MQTT broker. Use the Azure IoT Operations SDKs to create custom connectors that meet your specific requirements.
0 commit comments