I am in the middle of a project where I having to connect some IoT devices to azure using IoTHub. I have been following this guide: https://docs.microsoft.com/en-us/samples/azure-samples/functions-js-iot-hub-processing/processing-data-from-iot-hub-with-azure-functions/
And things are working fine, I have a device connected to the IoTHub called MyPythonDevice, so now in my code I would like to see this deviceId. In the examples given in the article above, we see a deviceId, but for me that is undefined
if I log it.
So I was searching and found the following code snippet:
context.log(context.bindingData.systemProperties["iothub-connection-device-id"])
But this returns the follwing
Exception: TypeError: Cannot read property 'iothub-connection-device-id' of undefined
That means that systemProperties
is undefined..
Any help on how to get the deviceId ?