0
votes

How can you set the MessageId of a Service Bus message using the Azure Functions output binding?

I've got the function writing to the SB topic fine with the following output binding in my pre-compiled C# Function App ...

[ServiceBus("targettopic", Connection = "SbConnectionString")]
    out PersonEvent outPerson,

But I need to set the MessageId to use in the duplicate detection history

1

1 Answers

3
votes

You'd have to return an instance of BrokeredMessage type instead of your custom class. That will enable you to set any property including message ID.