Unable to set custom properties on a ServiceBus message when using push-outputbinding
See original GitHub issueWhen working with Azure Functions V2 (Powershell) ServiceBus output binding we are not able to add any user attributes to the servicebus message since the push-outputbinding cmdlet takes the object passed in “value” as the message body (it will serialize the object and submit that as the message text/body). ideally one could craft a Service Bus message of type Microsoft.Azure.ServiceBus.Message and use this object as the input for the push-outputbinding which will then :
- Use the $message.body value as the contents of the serviceBus message,
- Allow us to set any other $message attributes we need and honor them. For example the custom attribute is of upmost importance:
Import-Module .\modules\Microsoft.Azure.ServiceBus.dll
$Message = New-Object Microsoft.Azure.ServiceBus.Message
$Message.UserProperties.Add("name", "alex")
# Should be able to send the message object out also and not just a string
Push-OutputBinding -Name demooutputSbMsg -Value $Message
Instead, when you call push-outputbinding, the whole $message object is processed as the actual body of the message, making it impossible to set custom attributes
see example:
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
Azure Service Bus output bindings for Azure Functions
Use Azure Service Bus output binding to send queue or topic messages. For information on setup and configuration details, see the overview.
Read more >Is it possible to add or define user or custom properties for ...
As per the service bus output binding document I don't see you can set the custom property on the message. Alternatively, rather than...
Read more >Question: Setting Custom Properties for Azure Service Bus
Hello, We're using the Azure Service bus quite heavily and are currently using all the predefined message properties - label, correlationID, etc.
Read more >Azure Service Bus and its Complete Overview
Azure Service Bus is a messaging service on cloud used to connect any applications, devices, and services running in the cloud.
Read more >Azure Service Bus Queues binding spec
Field Required Example
connectionString Y "Endpoint=sb://************"
queueName Y "queuename"
timeoutInSec N "60"
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any update on this? This makes routing the messages really hard.
also running into this issue. has there been any updates from the team regarding passing userproperties/systemproperties?