- Azure Event Grid documentation
- Connect your IoT devices to Azure Event Grid
- Azure Event Grid troubleshooting guide
Create an Azure Event Grid topic:
- In the Azure portal, navigate to the Event Grid service.
- Click on "Topics" and then "+ Event Grid Topic" to create a new topic.
- Provide a name, select the appropriate subscription and resource group, and choose the region.
- Click on "Create" to create the topic.
Configure Event Grid for MQTT support:
- Once the topic is created, click on the topic name to open its settings.
- In the topic settings, click on "Endpoints" and then "+ Event Subscription" to create a new subscription.
- Provide a name for the subscription.
- In the "Endpoint Type" section, select "Webhook" as the endpoint type.
- In the "Endpoint" field, provide the URL of the MQTT broker you want to connect to. This will depend on your specific setup.
- Configure any additional settings as needed and click on "Create" to create the subscription.
Configure the HMI:
- On your HMI device, open the configuration settings for the MQTT client.
- In the configuration settings, you will typically find options to set the MQTT broker URL, client ID, username, password, and other relevant settings.
- Use the MQTT broker URL you specified in the Azure Event Grid subscription endpoint as the broker URL in the HMI configuration.
- Configure the remaining settings (such as client ID, username, and password) as required by your MQTT broker and HMI device.
Test the MQTT communication:
- Save the configuration settings on the HMI device and ensure that it is connected to the network.
- Publish a test message to the Azure Event Grid topic or simulate an event that should trigger a message to be sent to the MQTT broker.
- Monitor the MQTT broker to see if it receives the messages from the Event Grid topic.
In addition to the above steps, here are a few KB articles that you can refer to for more information and troubleshooting: