简体   繁体   中英

IoT Monitoring: How to send only one e-mail in a certain timeframe using logic app?

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

当前逻辑应用

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?

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. 在此处输入图片说明

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)

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM