user13577841
user13577841

Reputation: 1

Retrieve device id from Service Bus Message in Azure Functions

Is it possible to retrieve the deviceId from the Service Bus Message in the Azure Function? I am currently using ServiceBusReceivedMessage.

Here is the message route:

  1. Device sends message to Iothub
  2. Iothub routes the message to the Service Bus Queue
  3. 2 triggers the Service Bus Triggered Function app listening to the queue.

Is it possible to retrieve the device id that sent the message to the Iothub in this case?

Upvotes: 0

Views: 167

Answers (1)

Roman Kiss
Roman Kiss

Reputation: 8235

Can you check an ApplicationProperties of the received message?

It should be there, "iothub-connection-device-id".

In the case if ApplicationProperties collection is null/empty, see here.

Upvotes: 0

Related Questions