0
votes

I'm trying to set up an IoT scenario with Azure. For demo purpose I've used this temperature monitoring scenario: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-monitoring-notifications-with-azure-logic-apps

  1. An IoT device is sending temperature data to IoT Hub
  2. IoT Hub is routing messages with a temperature > 30 to a service bus
  3. A logic app is reading that service bus and sends a warning e-mail

Current logic app

Now I have the problem that the logic app sends an e-mail for every message that exceeds the temperature limit (every message that is in my service bus). So my inbox will be spammed as soon as I heat up my IoT device.

In reality I would only want to receive one e-mail if my IoT Device overheats, then wait a certain time. How would I handle that in my logic app?

1
you could put Stream Analytics in between. Do filter exactly for that. In any case you will need some stateful component. I dont think LA can do it out of the box.silent

1 Answers

0
votes

You can achieve this by simply configuring the concurrency control (you can find this in the Settings of your LA trigger) of your Logic App trigger. By default, the concurrency value will be set to 25 and you have to change it to one. enter image description here

It allows only one message to be processed in your queue (irrespective to the number of messages in your queue) and you can define the interval in the UI of the Service Bus Queue trigger itself, (the time interval at which you need to get another email)

enter image description here