Device connection state events delayed

LeneKaethe 46 Reputation points

I am using Event Grid to forward events from my Azure IoT Hub to a custom webhook. Although I have no issues with "Telemetry" events, "Device Connected" and "Device Disconnected" events are delayed by several seconds. For example, if I connect a device to the Iot Hub and start sending immediately afterwards, the telemetry event is always first and the "Device connected" message takes several seconds to arrive at the webhook. Is there anything I can do to improve the performance of the connection status messages?

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,104 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
310 questions
{count} votes

Accepted answer
  1. Roman Kiss 2,236 Reputation points

    Hi Marlene,

    Based on the mentioned link:
    "The Azure IoT Hub doesn't send every single connection state, but publishes the current connection state taken at a periodic snapshot of 60sec until the flickering stops."

    In other words, if the device is connected and after 5 seconds is disconnected and then again the device is connected, the IoT Hub will emit only one event message to the AEG such as an eventType = Microsoft.Devices.DeviceConnected.

    Note, that the time 60 seconds for snapshotting a device connection state is not configurable.


    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful