Azure / azure-webjobs-sdk

Azure WebJobs SDK
MIT License
739 stars 358 forks source link

How to bind function return value to trigger in isolated worker? #3095

Open Y-Sindo opened 2 months ago

Y-Sindo commented 2 months ago

Original issue: https://github.com/Azure/azure-functions-dotnet-worker/issues/1496

Repro steps

Provide the steps required to reproduce the problem

Expected behavior

The client code as follows should get the return value from the function, instead of a null.

var responseFromServer = await connection.InvokeAsync<string>("SendMessage", "Hello from client");

And the client should print out the return value "This is message from SignalRTrigger" returned by function app code

Actual behavior

The variable responseFromServer is always null.

Known workarounds

No

Related information

Provide any related information

The return value works if the function app is in C# in-process mode.

During debug, I've found that the SignalR Microsoft.Azure.WebJobs.Host.Triggers.ITriggerData.ReturnValueProvider.SetValueAsync(object value, CancellationToken cancellationToken) is always invoked with parameter value=null with isolated worker.

Anyone could provide some hints on how to troubleshoot the problem? @brettsam @fabiocav