Forum Discussion
How to publish user-defined topic to IoT hub?
I am new to azure ecosystem. I followed some examples and documents and able to connect to the Azure IoT Hub and able to send data. The data is being sent on device/<deviceID>/messages/events topic(telemetry message) topic. From same application, I am not able to publish the message on custom topic(user-defined). Can you please help me if I am missing any additional configuration/settings for Azure IoT?
1 Reply
Seems not any setting missing but Azure IoT Hub not allowing devices publish to arbitrary, custom MQTT topics. If you would like to continue using IoT Hub, you may consider to send everything through the built‑in telemetry topic and use application properties to logically classify or route messages. However, if your solution genuinely depends on user‑defined MQTT topics and classic pub/sub behavior, then Azure Event Grid with MQTT support is the better fit for that requirement.