azure function service bus output message properties
@l--''''''---------'''''''''''' You need to access the Microsoft.Azure.ServiceBus.Message
class. Let's say you have some json called messageBody
and you have some list of properties that you want to add to the message. You can achive it like the below example.
Make sure you add using Microsoft.Azure.ServiceBus;
var myCustomProperties = new List<Dictionary<string,string>>();
var message = new Message(Encoding.UTF8.GetBytes(messageBody));
foreach (var userProperty in myCustomProperties)
{
message.UserProperties.Add(userProperty.Key, userProperty.Value);
}
There is an open issue for this at https://github.com/Azure/Azure-Functions/issues/454
Some customers seemed to have found a workaround. Perhaps you can try their approach mentioned here https://github.com/Azure/Azure-Functions/issues/454#issuecomment-375154151