丰富设备生命周期事件Azure IoT中心

问题描述

我需要丰富在事件网格中收到的设备生命周期事件[创建,删除,连接,断开连接]。 我的解决方案中的事件流如下:-

Device send registration request to IoT Hub -> Event grid triggers device life cycle event -> Event grid routes device life cycle event to Event Hub

由于我的应用程序(即仅是消费者到事件中心),这就是我将所有事件从事件网格路由到事件中心的原因。 现在,我需要丰富在事件中心收到的事件。例如,设备连接事件应如下所示:

{
  "body": [
    {
      "id": "58b1872d-1388-8043-dacc-6322ca65d2bf","topic": "SOME_TOPIC","subject": "devices/diablo-central-park-1","eventType": "Microsoft.Devices.DeviceConnected","data": {
        "deviceConnectionStateEventInfo": {
          "sequenceNumber": "SOME_SEQ_NUMBER"
        },"hubName": "IOT_HUBNAME","deviceId": "DEVICE_ID"
      },"dataVersion": "","metadataVersion": "1","eventTime": "2020-10-16T06:33:42.2418032Z"
    }
  ],"properties": {
    "aeg-output-event-id": "SOME_ID","aeg-subscription-name": "SOME_NAME,"aeg-delivery-count": "0","aeg-data-version": "","aeg-metadata-version": "1","aeg-event-type": "Notification","enrichedProperty": "enrichedValue"
  },"offset": "25769816448","sequenceNumber": 2197,"enqueuedTimeUtc": "2020-10-16T06:33:49.321Z",""systemProperties": {}
}

因此,在上述事件JSON中,我应该在属性字段中获得enrichedProperty。我已经完成了两次更改事件的消息充实,通过门户上的IoT中心刀片中的消息路由(充实消息)进行遥测。但是对于设备生命周期事件,我找不到办法。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)