Figured it out! Create a new POCO and move the output binding from the function to the new return type.
[Function(nameof(MyFunction))]
public async Task<SignalRMessages> MyFunction([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequestData req)
{
HttpResponseData response = req.CreateResponse(HttpStatusCode.Accepted);
SignalRMessageAction[] messages = [
new SignalRMessageAction(hubActionName, ["TEST1", "TEST1"]),
new SignalRMessageAction(hubActionName, ["TEST2", "TEST2"])
];
return await Task.FromResult(new SignalRMessages(messages));
}
public class SignalRMessages(IEnumerable<SignalRMessageAction> messages)
{
[SignalROutput(HubName = hubName, ConnectionStringSetting = appSettingSignalR)]
public IEnumerable<SignalRMessageAction> Messages { get; set; } = messages;
}
More detailed answer in this SO answer.