I am working on a software, where I need to send a JSON payload to a wide range of clients. Here the client is a windows PC, where my software is running. On some event, I need to trigger some actions on the client.
To achieve this I was using AWS IoT Core, so that all of the clients are connected to there group (or can say topic
at AWS IoT) by subscribe on the topic through MQTT
. And I will publish the JSON payload to the topic through MQTT
. So it will notify to all of the connected clients. Here the topic is custom, can set any topic. And It does not ask to create multiple devices (at AWS it is Things
) at the AWS IoT. Just created a single Thing over there, exported its certificate and using the same certificate across all of the clients. Everything is working fine.
But now I want to switch at Azure. I checked the Azure IoT Hub. I created a Hub and a device in the Hub. I am able to send message to the device. But it is not possible to send messages at custom topic. The topic includes the created device id, so that it will fixed for that device. But in my scenario, I need custom and multiple topics, and I don't want to create multiple devices at Azure. Also it is not clear that the message which I sent is via MQTT
protocol or not.
For POC, I am using following Azure IoT Hub REST API to send message on a device:
curl --location --request POST 'https://{AzureIoTHubNAme}.azure-devices.net/devices/{AzureIoTHubDevice}/messages/events/?api-version=2018-06-30' \
--header 'authorization: SAAS-TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"SOME-KEY": "SOME-VALUE"
}'
With Azure how can I achieve the same which I am using with AWS IoT? If there are any suggestions or any other Azure service which can fulfill my requirement, please help me to find out.
Thanks.