Hello @AhsanHabib-1895 ,
Built-in output binding in javascript based function currently does not support setting message properties other than body. There is an open github issue similar to this. Also. please feel free to provide feedback as feature request here.
As an work around, you can use service bus client to send message to a queue instead of using output binding like below.
- You need to install @azure/service-bus npm package.
npm install @azure/service-bus
- Import the required service client at the top of your index.js.
const { ServiceBusClient } = require("@azure/service-bus");
- Follow the below code sample to directly use SB client to send message with session id: const sbClient = ServiceBusClient.createFromConnectionString(connectionString);
const queueClient = sbClient.createQueueClient(queueName);
const sender = queueClient.createSender();
const message= {
body: 'your message body, can be string, js object or byte array',
sessionId: 'your session id'
};
await sender.send(message);
Also, if you prefer, you can leverage C# based function which has built-in support to set properties of BrokeredMessage object in output binding.
Please let me know if you have any question. Also if it helps, please consider accepting as answer which can help other community members with similar queries.