Azure / Azure/azure-functions-dotnet-worker

ServiceBusOutput does not support byte[] as claimed

Open
#2,547 1 comment 1 reaction 2 assignees Claimed by @brettsam View on GitHub
area: migration extensions: service-bus
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

### Description

The documentation says that [ServiceBusOutput] supports returning byte[], string, or an object which will be serialized as JSON.

When I specify return type as byte[] and return a byte[], the message body that results is the literal string "System.Byte[]" - as if the framework is calling ToString() on the byte array.

### Steps to reproduce

```
[Function(nameof(ForwardToQueue))]
[ServiceBusOutput("OutputQueueName", Connection = "Connection")]
public byte[] ForwardToQueue(
[ServiceBusTrigger("InputQueueName", Connection = "Connection")]byte[] message)
{
return message;
}
```
Expected: The function forwards a message with the same body to another queue.
Actual: The function creates a message with the literal body "System.Byte[]"

Microsoft.Azure.Functions.Worker.Sdk 1.17.2
Microsoft.Azure.Functions.Worker.Extensions.ServiceBus 5.20.0

.NET 6 isolated

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.