Search code examples
azure-functionssignalr

SignalR Azure Functions resulted only one output binding is supported


I have an Azure Functions with SignalR built using .NET 7 (dotnet-isolated). A few days ago it had no problem. But now it generete an error message.

System.InvalidOperationException: Only one output binding is supported when using a binding assigned to '$return'. Found a total of 2 bindings. For more information: https://aka.ms/dotnet-worker-poco-binding.

[Function("broadcast")]
[SignalROutput(HubName = "brick_broadcaster", ConnectionStringSetting = "signalrConnection")]
public SignalRMessageAction Broadcast([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequestData req, FunctionContext functionContext)
{
    using var bodyReader = new StreamReader(req.Body);
    return new SignalRMessageAction("brick")
    {
        Arguments = new[] { bodyReader.ReadToEnd() },
    };
}

Solution

  • I have resolved this problem. The problem appeared when I updated the Microsoft.Azure.Functions.Worker.Sdk to version 1.16.2. Now I downgrade to lower version 1.15.1 and it works fine.