Azure-webjobs-sdk: Consider expanding EventHub/ServiceBus binding data to include common properties

Created on 2 Feb 2017  路  9Comments  路  Source: Azure/azure-webjobs-sdk

This comes up often, most recently here on SO: https://stackoverflow.com/questions/42003600/azure-iot-hub-eventhub-and-functions. People need to access the event DeviceId, SequenceNumber, etc. and end up having to change their method signature to drop down to a lower EventData binding to access it.

If we include this (and other interesting properties) in the binding data, it would facilitate these scenarios. Similar to the way our Azure Queue trigger exposes binding data for dequeue count, enqueue time, and other message properties.

For languages other than C# this would be very useful, because in those languages there isn't even a workaround currently to bind to EventData. Adding these to BindingData would also allow the properties to be used in input/output binding expressions.

Feature

Most helpful comment

Within 2 weeks is the plan. We generally try to keep a bi weekly release cadence.

All 9 comments

Also came up recently for BrokeredMessage.ReplyTo http://stackoverflow.com/questions/42143133/how-to-dynamically-bind-service-bus-brokeredmessage-in-an-azure-function/42143407#42143407. We should also add some of these useful BM properties to the static binding data collection as well to facilitate these scenarios.

This also just came up again for access to SB BrokeredMessage properties: http://stackoverflow.com/questions/42385995/azure-functions-get-service-bus-brokeredmessage-with-nodejs

Thanks for starting this thread. I have a similar requirement to receive message properties of Service Bus queue along with message in functions app

Sample message with its properties :

servicebusqueue

Current implementation only provides message Body

Samples available at below link :
https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus#trigger-usage

Added first class binding data support for many of the important ServiceBus and EventHub message/event properties.

For EventHub:

  • PartitionContext
  • PartitionKey
  • Offset
  • SequenceNumber
  • EnqueuedTimeUtc
  • Properties
  • SystemProperties

For ServiceBus:

  • DeliveryCount
  • DeadLetterSource
  • ExpiresAtUtc
  • EnqueuedTimeUtc
  • MessageId
  • ContentType
  • ReplyTo
  • SequenceNumber
  • To
  • Label
  • CorrelationId
  • Properties

Hi mathewc, very happy to see these binding info are added! It's great news for Azure Function users like us. A little question, when will it be deployed to live production? Thanks

Within 2 weeks is the plan. We generally try to keep a bi weekly release cadence.

Badly need the custom properties on the ServiceBus NodeJS trigger, looking fwd to the release!

FYI - I've written up some wiki doc for this here https://github.com/Azure/azure-webjobs-sdk-script/wiki/Trigger-Binding-Data. That landing page is Azure Functions specific, but links to the base WebJobs SDK documentation.

So if we have a systemproperty with the key 'iothub-connection-device-id' whose value we would like to use as id binding for another input (in azure functions), how should we write it?

ping @mathewc

Was this page helpful?
0 / 5 - 0 ratings