How-To Guides
...
Integration Guides
Azure IoT Hub Guides

Send Data to Azure IoT Hub with an SAS Key

6min
review the following guide for setting up an outbound data integration between litmus edge and azure iot hub using an sas key before you begin you must first set up an azure iot hub docid\ ibr6xwso2itgudtivu7vt step 1 add a device follow the steps to connect a device docid 3eyafppweuvmblcey17sq the device will be used to store tags that will be eventually used to create outbound topics in the connector make sure to select the enable data store checkbox step 2 add tags after connecting the device in litmus edge, you can add tags docid 8se7z3pmrfwl1nmzcwalx to the device create tags that you want to use to create outbound topics for the connector step 3 add the azure iot hub using sas key connector follow the steps to add a connector docid\ ogw7fkqbwidbabn4wl5rr and select the mqtt azure iot hub using sas key provider configure the following parameters name enter a name for the connector hostname enter the ip address or server fqdn of the mqtt broker (must be reachable from your edge device) port the mqtt broker's port number the default value is 8883 client id copy the device id of your edge device from the iot devices page in the azure portal and paste it here sas key copy the primary or secondary shared access key from the iot devices page in the azure portal and paste it here parallel publish count the maximum number of concurrently published messages the default value is 16 integration topic the default topic to publish or subscribe to devices/\[deviceid]/messages/events/ replace \[deviceid] with the device id copied from azure token ttl the token expiry time in minutes the default value is 1440 lwt topic the topic for mqtt's last will and testament feature lwt payload the payload for mqtt's last will and testament feature lwt payload type the payload type for mqtt's last will and testament feature the options are string and base64 lwt qos the quality of service value for mqtt's last will and testament feature lwt retained select this check box to retain the value for mqtt's last will and testament feature throttling limit the maximum number of messages per second to be processed the default value is zero, which means that there is no limit persistent storage when enabled, this will cause messages to undergo a store and forward procedure messages will be stored within litmus edge when cloud providers are online queue mode select the queue mode as lifo (last in first out) or fifo (first in first out) selecting lifo means that the last data entry is processed first, and selecting fifo means the first data entry is processed first step 4 enable the connector after adding the connector, click the toggle in the connector tile to enable it if you see a failed status, you can review the manage connectors docid 3u7jzldinehy8shvifd d and relevant error messages step 5 create outbound topics for connector you will now need to create topics from the tags you added in step 2 before creating the topics copy the raw topic parameter for all tags you want to use for topics see manage tags docid 19fclype fbpdvcxxwrb4 for more information to create topics click the connector tile the connector dashboard appears click the topics tab add topics to the connector with the details below see add topics to connectors docid\ wvuuocitifll77yvuem8f for more information data direction select local to remote outbound local data topic paste the raw topic for the tag created in step 2 remote data topic verify the format of the remote data topic is devices/\[deviceid]/messages/events/ replace \[deviceid] with the device id parameter configured for the connector devices/mydevice/messages/devicebound/%24 to=%2fdevices%2fmessages%2fdevicebound enable click the toggle to enable the topic click yes to add the topic after adding all required topics, navigate to the integration pane from the connector tile, ensure the connector is not disabled and still shows a connected status step 6 manage data in azure once data is sent to the azure iot hub, you can manage it as needed refer to the azure iot hub documentation to learn more