Azure IoT Hub Integration Response

I’m hoping someone can help me with a question. I want to implement the following end-to-end functionality with an Electron module and Azure IoT Hub integration:

  • Electron module publishes an event with data
  • Particle console pushes event to Azure IoT Hub via the integration
  • IoT Hub handles the event and stuffs the data into a database
  • IoT Hub sends an ACK to confirm the event data has reached it’s final destination
  • Electron module receives the ACK and deletes the data locally

I’m interested in the bolded part. I want to know that the data has been received and processed by the IoT Hub before deleting it from the Electron module.

However, looking at the Particle integration for Azure Iot Hubs, it says “Azure IoT Hub integrations do not return any data for devices to receive.”

So to my question, is there a way to implement some type of ACK using the Azure IoT Hub integration? Or do I have to use a webhook integration to get a response back to the Electron module?

Thanks for any help.

The Azure integration is one-way so it’s not possible to do that part.

However it is probably possible to do it using a slightly different technique. For example, the guaranteed delivery example in this project does it using Google cloud services. It’s conceptually the same idea to do it with Azure, but you can’t probably do it only with IoT Hub.

Thanks for replying. That’s a shame there’s no built-in way to guarantee end-to-end delivery. I might look into something simple like exposing a function on the Electron through the cloud, and then having an Azure service invoke that function to confirm delivery. Or move to a webhook integration that can receive an HTTPS response. Do you have any thoughts on the pros/cons of those two options?

seems to me that azure would have some type of notification system in place to acknowledge stuff. it’s not gonna be the direct ACK you want but isn’t there a method to inform via email or sms if a certain activity has taken place? ideally you would want to see if a fairly immediate sms could be sent to the electron but even an email sent to a service that could translate to sms to send to electron would work. although, even if possible either solution may not work within your time constraints, like how long can you wait for a response?

Hi @superloop
the way I have seen this implemented in the past is to expose an API in Azure that will be hit by a Particle webhook that will be triggered by an Electron publish().
In the right way:

Electron publish() -> Particle webhook -> Azure API -> Azure db
then you wait for the response in the publish (subscribing to the response or something, I forgot), so when the Azure API returns a response, webhook relays it to the Electron and your firmware can be sure the data was stored.

(I see now that you hint to this in your post)
Cheers
Gustavo.

Thanks for taking the time to reply. Similar to your example, I did some early prototyping with webhooks which did send a response all the way back to the Electron module. Now I’m trying out the IoT Hub integration, but unfortunately there is no response with this implementation.

I think I will either go back to the webhooks, or I will implement an Azure service that invokes a function on the Electron as the response. I’m not sure if one option provides an advantage over the other, I’ll have to mull it over.

1 Like