Reputation: 1000
I'm facing issue to send a complete brokered message to an azure service bus output in azure function in javascript. The documentation only show a simple body message https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus without any customerProperties.
My attempts to create a full brokered message failed so far, everything goes into the body.
var message = {'body' : 'test', 'customProperties' : {'fromsystem':'sap'}};
context.bindings.outputSbMsg = message;
context.done(null, res);
Upvotes: 4
Views: 2622
Reputation: 2726
Unfortunately this is one of the limitations of node, as we lose some type information that we have in C#.
You could be trying to send a message with a body
of test
with custom properties, but you could also be trying to send the entire object as the body, with a body
sub-property. Azure Functions make the assumption that everything that you return should go into the body.
As a workaround, you could:
BrokeredMessage
typeBrokeredMessage
you wantUpvotes: 4