I am new to Azure managed services. I am not sure about the below mentioned approach is the best approach for the IOT HUB to WEB APP communication.
In IOT Hub, we have created some devices. So, Those devices will send the payload in bytes format to IOT hub.
Now, from IOT hub, I have to pass this payload to Web app which is hosted in Azure and process those payloads and send the response payload to that device using IOT hub service-client.
For passing the payload from IOT Hub to the Web app, I have done the following.
Approach followed:
Step 1: Created a Service Bus namespace in Azure and created a Queue(boxtoserverqueue) in service bus namespace.
Step 2: I have created the Endpoint for the above Servicebus queue in IOT Hub(Custom Endpoint)
Step 3: I have created a Servicebus queue trigger Continuous running WebJob inside my web app. So, this WebJob will listen to the Servicebus message. Whenever the BrokerMessage is added to the Service Bus Queue from the IOT Hub, This Web job will get triggered with the Broker Message. So, then I will process the Message Payload and send back to Azure IOT Hub directly using IOT hub serviceClient.
Am I in the right direction with this approach or Should I think about Event Hub client to achieve the above communication between the IOT Hub to Web APP or another prototype is available for this communication?
Note: I read, If I use Event Hub client in my web app, I should pool the Event hub client for listening to the Messages While(true){} loop. not sure about this.
Which approach Should be the best approach for this IOT HUB to Web App communication?
Please share your thoughts on this?
Thanks in advance!