Azure / Azure/azure-functions-dotnet-worker
Returning ServiceBusMessage doesn't work correctly
- Dominant language
- C#
- Stars
- 466
- Forks
- 215
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 7
Description
When returning a `ServiceBusMessage`, the message posted contains incorrect information.
```
[Function(nameof(Run))]
[ServiceBusOutput("audit", Connection = "AzureServiceBus")]
public async Task Run([ServiceBusTrigger("Notifications", Connection = "AzureServiceBus")] ServiceBusReceivedMessage message)
{
// removed for brevity
return new ServiceBusMessage(rawMessage);
}
```
For an incoming message

The returned message body is
1 - missing original header
2 - incorrect body
3 - incorrect content type
## Expected:

1 - the original header (`EventType`) is found
2 - original body
3 - correct content type
Contributor guide
No contributing guide indexed for this repository
Research direction
The report provides a C# reproducer through Run using ServiceBusMessage, ServiceBusOutput, ServiceBusTrigger, and ServiceBusReceivedMessage. Start by running that flow and tracing how the output binding converts the returned message. Done means the posted message preserves the original EventType header, body, and content type shown in the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100