How to send MQTT events to Microsoft Fabric via Event Hubs using Azure Event Grid

This article shows you how to use Azure Event Grid to send events from MQTT clients to Microsoft Fabric data stores via Azure Event Hubs.

High-level steps

  1. Create a namespace topic that receives events from MQTT clients.
  2. Create a subscription to the topic using Event Hubs as the destination.
  3. Create an event stream in Microsoft Fabric with the event hub as a source and a Fabric KQL database or Lakehouse as a destination.

Event flow

  1. MQTT client sends events to your Event Grid namespace topic.
  2. Event subscription to the namespace topic forwards those events to your event hub.
  3. Fabric event stream receives events from the event hub and stores them in a Fabric destination such as a KQL database or a lakehouse.

Detailed steps

  1. Follow steps from the article: Tutorial: Use namespace topics to route MQTT messages to Azure Event Hubs (Azure portal) to:
    1. Create an Event Grid namespace in the Azure portal.
    2. Create a namespace topic.
    3. Enable managed identity for the namespace.
    4. Enable MQTT broker for the Event Grid namespace.
    5. Create an Event Hubs namespace.
    6. Create an event hub.
    7. Grant Event Grid namespace the permission to send events to the event hub.
    8. Create an event subscription to namespace topic with the event hub as the endpoint.
    9. Configure routing for the Event Grid namespace.
    10. Create clients, topic space, and permission bindings.
    11. Use MQTTX tool to send a few test events or messages.
  2. In Microsoft Fabric, do these steps:
    1. Create a lakehouse.
    2. Create an event stream.
    3. Add your event hub as an input source.
    4. Add your lakehouse as a destination.
  3. Publish events to the namespace topic.

Next steps

Build a Power BI report as shown in the sample: Build a near-real-time Power BI report with the event data ingested in a lakehouse.

-