I have setup routing to a Service Bus Queue using Azure IoT Hub. I followed this tutorial to get it working: https://azure.microsoft.com/en-gb/blog/how-to-use-azure-functions-with-iot-hub-message-routing/.
In my function I am trying to get the DeviceId so that I can verify the device that the message came from. I have a string parameter called message which receives The message I have sent. However, I need to get the DeviceId from the message. I tried to change the type to EventData but I got a serialisation error because of the JSON message type I think.
I will update this post with the actual code and error message tomorrow but wondered if anyone had come across this issue?
BrokeredMessage
class instead ofEvenData
. – Mikhail Shilkov