Microsoft Azure provides IoT Hub. It might sound great because it has support for MQTT. It is very important to mention that Azure IoT Hub has a different way how it operates than Mosquitto which means that architecture of your IoT solution must be different.
Let’s check differences.
- Mosquitto is 1883 which is not secure, it is possible to enable TLS
- IoT Hub 8883 secured by TLS/SSL (only)
Publishing and subscription of messages:
- Mosquitto clients can subscribe or publish any topic
- IoT Hub supports only device-to-cloud and cloud-to-device
That’s a huge difference. In the case of Mosquitto you can easily build network of devices which can communicate together and management logic could be injected by Node-RED. In the case of IoT Hub whole interaction is managed by the cloud.
If you still want to play with IoT Hub and MQTT, I recommend article written by Satish Pagare who explains how to use mosquitto_sub and mosquitto_pub to interact with IoT Hub.