'Partial data loss in JSON deserialization between IoT Hub and ASA Input

Setup is: IoT Hub > input into > Stream Analytics

I currently have (3) sensors and an azure gateway from ncd.io which are all reporting great into Azure IoT Hub.

Only two elements the record data from my sensors are making it through the auto JSON deserialization when setting up an IoT Hub input in ASA.

I have a device setup in IoT Hub which reports the correct Device Twin data from my local gateway as follows:

"reported": {
    "nodes": {
      "SN0013A20041DADDF7": {
        "firmware_version": 10,
        "transmission_count": 192,
        "reserve_byte": 0,
        "battery_level": 3.29406,
        "type": 1,
        "node_id": 0,
        "rssi": 100,
        "humidity": 27.93,
        "temperature": 22.28
      },
      "SN0013A20041DADD51": {
        "firmware_version": 10,
        "transmission_count": 175,
        "reserve_byte": 0,
        "battery_level": 3.29406,
        "type": 1,
        "node_id": 0,
        "rssi": 100,
        "humidity": 42.25,
        "temperature": 22.55
      },
      "SN0013A20041DADE33": {
        "firmware_version": 10,
        "transmission_count": 217,
        "reserve_byte": 0,
        "battery_level": 3.29406,
        "type": 1,
        "node_id": 0,
        "rssi": 100,
        "humidity": 39.33,
        "temperature": 22.62
      }
    },

I setup the input in ASA from my IoT Hub as JSON with no compression. The result in ASA looks great, but first position 'node' seems to be excluded from the result.

 [
  {
    "nodes": {
      "SN0013A20041DADE33": {
        "firmware_version": 10,
        "transmission_count": 164,
        "reserve_byte": 0,
        "battery_level": 3.29406,
        "type": 1,
        "node_id": 0,
        "rssi": 100,
        "humidity": 39.01,
        "temperature": 23.08
      }
    },
    "EventProcessedUtcTime": "2022-05-02T20:39:23.3568635Z",
    "PartitionId": 3,
    "EventEnqueuedUtcTime": "2022-05-02T19:55:43.2820000Z",
    "IoTHub": {
      "MessageId": null,
      "CorrelationId": null,
      "ConnectionDeviceId": "***",
      "ConnectionDeviceGenerationId": "***",
      "EnqueuedTime": "2022-05-02T19:55:43.1570000Z"
    }
  },
  {
    "nodes": {
      "SN0013A20041DADD51": {
        "firmware_version": 10,
        "transmission_count": 122,
        "reserve_byte": 0,
        "battery_level": 3.29406,
        "type": 1,
        "node_id": 0,
        "rssi": 100,
        "humidity": 42.09,
        "temperature": 22.62
      }
    },
    "EventProcessedUtcTime": "2022-05-02T20:39:23.3568635Z",
    "PartitionId": 3,
    "EventEnqueuedUtcTime": "2022-05-02T19:55:40.8290000Z",
    "IoTHub": {
      "MessageId": null,
      "CorrelationId": null,
      "ConnectionDeviceId": "***",
      "ConnectionDeviceGenerationId": "***",
      "EnqueuedTime": "2022-05-02T19:55:40.8130000Z"
    }
  },
  {
    "nodes": {
      "SN0013A20041DADE33": {
        "firmware_version": 10,
        "transmission_count": 163,
        "reserve_byte": 0,
        "battery_level": 3.29406,
        "type": 1,
        "node_id": 0,
        "rssi": 100,
        "humidity": 38.9,
        "temperature": 23.14
      }
    },
    "EventProcessedUtcTime": "2022-05-02T20:39:23.3568635Z",
    "PartitionId": 3,
    "EventEnqueuedUtcTime": "2022-05-02T19:55:03.7180000Z",
    "IoTHub": {
      "MessageId": null,
      "CorrelationId": null,
      "ConnectionDeviceId": "***",
      "ConnectionDeviceGenerationId": "***",
      "EnqueuedTime": "2022-05-02T19:55:03.6710000Z"
    }
  },
  {
    "nodes": {
      "SN0013A20041DADD51": {
        "firmware_version": 10,
        "transmission_count": 121,
        "reserve_byte": 0,
        "battery_level": 3.29406,
        "type": 1,
        "node_id": 0,
        "rssi": 100,
        "humidity": 42.22,
        "temperature": 22.65
      }
    },

There are really no options I can find to adjust this as it is all part of a single record... I can query the data I do receive and output it no problem.

Example output in ASA

Reference of the issue



Solution 1:[1]

It appears that upon a deeper dive into the sensor, the missing sensor had an issue with reporting and was significantly behind the other two devices on the hub which caused it to be stripped from the result.

After power cycling the sensor and sampling the data I was able to receive all three sensors and pass them through to PowerBI with no issues.

Thanks @Florian-Eiden for all your help!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JGora