Azure-webjobs-sdk: Cannot access IOT specific message properties in functions V2

Created on 21 Dec 2018  ·  14Comments  ·  Source: Azure/azure-webjobs-sdk

In functions V1, a JS function with an eventhub trigger that was wired to an IOT hub would see a bunch of IOT specific metadata:

bindingData:
    …
    "systemPropertiesArray": [
      {
        "iothub-connection-device-id": "miye-device0",
        "iothub-connection-auth-method": "{\"scope\":\"device\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",
        "iothub-connection-auth-generation-id": "636640121350566756",
        "iothub-enqueuedtime": "2018-12-13T14:42:43.358Z",
        "iothub-message-source": "Telemetry",
        "x-opt-sequence-number": 6127,
        "x-opt-offset": "3015760",
        "x-opt-enqueued-time": "2018-12-13T14:42:43.403Z",
        "enqueuedTimeUtc": "2018-12-13T14:42:43.403Z",
        "sequenceNumber": 6127,
        "offset": "3015760"
      }
    ],

In V2, this metadata is not accessible:

bindingData:
   …
  "systemPropertiesArray": [
      {
        "SequenceNumber": 6128,
        "Offset": "3016216",
        "PartitionKey": null,
        "EnqueuedTimeUtc": "2018-12-13T14:55:43.94Z"
      }
    ],
   …

Some testing with the Event Hubs .NET Standard SDK indicates that this is not due to a change in event hubs SDK behavior and its most likely that these properties are somehow filtered out/hidden by functions. Further investigation is required.

bug

Most helpful comment

Fix is released to functions and webjobs sdk : https://github.com/Azure/azure-webjobs-sdk/releases/tag/v3.0.5 .

Is this fix still working? "systemPropertiesArray " is still coming as undefined

All 14 comments

We have the root cause for this issue detailed here https://github.com/Azure/azure-functions-templates/issues/811

@pragnagopa Can you advise on availability of the fix?
We need support for node v8.11 in functions, which forces us to use functions v2 and because of this issue, we can't identify the source of telemetry messages coming from IoTHub.

When can we expect a fix? It's a security issue for us since we cannot in a secure manner identify the sending device id.

+1 to capture request from a Java customer (can provide more details offline)

I also would very much appreciate it if this can be solved as soon as possible. We need this for coming production functionality. Any update?

Do you have any updates on the release for this fix?

Do you have any updates on the release for this fix?

I would also like to know when we can use this functionality. Happy to hear that it has been merged though 👍

Fix is released to functions and webjobs sdk : https://github.com/Azure/azure-webjobs-sdk/releases/tag/v3.0.5 .

@pragnagopa and does this fix apply to Linux servers?

@jameshowe -If you are referring to function app on a Linux app service plan, then yes Functions v2.0.12353 or higher includes this fix.

Nice, thanks :-)

@jameshowe -If you are referring to function app on a Linux app service plan, then yes Functions v2.0.12353 or higher includes this fix.

@pragnagopa Yep, I was - thanks. One other question, given systemPropertiesArray is an array, and we can receive messages in batches, how do we reliably map the correct device ID to the message(s) we are processing?

@jameshowe -If you are referring to function app on a Linux app service plan, then yes Functions v2.0.12353 or higher includes this fix.

@pragnagopa Yep, I was - thanks. One other question, given systemPropertiesArray is an array, and we can receive messages in batches, how do we reliably map the correct device ID to the message(s) we are processing?

Answer my own question - each object in systemPropertiesArray will map (by index) to each message in the batch :)

Fix is released to functions and webjobs sdk : https://github.com/Azure/azure-webjobs-sdk/releases/tag/v3.0.5 .

Is this fix still working? "systemPropertiesArray " is still coming as undefined

Was this page helpful?
0 / 5 - 0 ratings