使用 DeviceLifecycleEvents 源的 IoT 中心消息路由不起作用
IoT Hub message routing with DeviceLifecycleEvents source does not work
我已经在使用 IoT 中心并已配置消息路由以将 TwinChangeEvents
路由到事件中心。具有 EventHubTrigger
的 Azure 函数处理消息。这工作得很好。
现在,我想配置消息路由以将 DeviceLifecycleEvents
路由到另一个事件中心。同样,另一个带有 EventHubTrigger
的 Azure 函数应该处理消息。
但是,当我连接或断开设备时,该功能没有被触发。
当我将消息路由的数据源更改为 TwinChangeEvents
时,该函数按预期触发(当然是错误的消息)。也就是说,我非常有信心我对事件中心和功能的配置是正确的。
此外,我尝试在 IoT 中心配置事件订阅,将生命周期事件发送到事件中心。我认为此选项使用事件网格。无论如何,此配置会按预期触发该功能。只有在生命周期事件中使用消息路由时才会出现此问题。
任何人都可以指出为什么邮件路由不起作用的解决方案吗?我是否缺少 IoT 中心的配置?
遗憾的是,事件中心不支持设备连接和断开连接事件。微软支持也证实了这一点。以下是我从他们那里得到的回复:-
IoT Device Lifecycle events designed only for device create and delete events. From the description you want your IoT Hub to trigger following events to your Event Hub: Device Created Device Deleted Device Connected Device Disconnected With this requirement you should create a new Event Subscription with Event Grid instead of configuring the IoThub message routing with Device Lifecycle Events as data source. Please go to the IoT Hub and create a new Event Subscription by this path: IoT Hub->Events->+Event Subscription
一天结束时,我为所有设备生命周期事件创建了一个事件订阅,并将它们路由到我的自定义事件中心端点。我想你也可以这样做,如果你只想订阅事件中心而不是事件网格。
编辑:- 消息路由现在支持 Device connection state events
。 Non telemetry events 事件中心消息路由支持。
Finally, if a route is created with data source set to device
connection state events, IoT Hub sends a message indicating whether
the device was connected or disconnected.
我已经在使用 IoT 中心并已配置消息路由以将 TwinChangeEvents
路由到事件中心。具有 EventHubTrigger
的 Azure 函数处理消息。这工作得很好。
现在,我想配置消息路由以将 DeviceLifecycleEvents
路由到另一个事件中心。同样,另一个带有 EventHubTrigger
的 Azure 函数应该处理消息。
但是,当我连接或断开设备时,该功能没有被触发。
当我将消息路由的数据源更改为 TwinChangeEvents
时,该函数按预期触发(当然是错误的消息)。也就是说,我非常有信心我对事件中心和功能的配置是正确的。
此外,我尝试在 IoT 中心配置事件订阅,将生命周期事件发送到事件中心。我认为此选项使用事件网格。无论如何,此配置会按预期触发该功能。只有在生命周期事件中使用消息路由时才会出现此问题。
任何人都可以指出为什么邮件路由不起作用的解决方案吗?我是否缺少 IoT 中心的配置?
遗憾的是,事件中心不支持设备连接和断开连接事件。微软支持也证实了这一点。以下是我从他们那里得到的回复:-
IoT Device Lifecycle events designed only for device create and delete events. From the description you want your IoT Hub to trigger following events to your Event Hub: Device Created Device Deleted Device Connected Device Disconnected With this requirement you should create a new Event Subscription with Event Grid instead of configuring the IoThub message routing with Device Lifecycle Events as data source. Please go to the IoT Hub and create a new Event Subscription by this path: IoT Hub->Events->+Event Subscription
一天结束时,我为所有设备生命周期事件创建了一个事件订阅,并将它们路由到我的自定义事件中心端点。我想你也可以这样做,如果你只想订阅事件中心而不是事件网格。
编辑:- 消息路由现在支持 Device connection state events
。 Non telemetry events 事件中心消息路由支持。
Finally, if a route is created with data source set to device connection state events, IoT Hub sends a message indicating whether the device was connected or disconnected.