question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to set custom properties on a ServiceBus message when using push-outputbinding

See original GitHub issue

When 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 :

  1. Use the $message.body value as the contents of the serviceBus message,
  2. 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: image

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
spaellingcommented, Sep 12, 2019

Any update on this? This makes routing the messages really hard.

0reactions
gcmlpfaltahercommented, Sep 23, 2021

also running into this issue. has there been any updates from the team regarding passing userproperties/systemproperties?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found