Azure / azure-functions-signalrservice-extension

Azure Functions bindings for SignalR Service. Project moved to https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService .
MIT License
96 stars 48 forks source link

Expression Bindings for SignalRTrigger HubName do not function. #159

Closed holtalanm closed 3 years ago

holtalanm commented 3 years ago

Issue:

Using Expression Bindings (https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-expressions-patterns#binding-expressions---app-settings) for the SignalRTrigger HubName property (I didn't check other properties, but I assume they may have similar issues) does not cause it to resolve the HubName from application settings.

i.e. setting HubName to something like %SignalRHubName% doesn't actually bind based on application settings.

Reproduction:

I set up a github project illustrating what I am seeing. The project contains three Functions -- one for Negotiate, and two OnConnected functions. One of the OnConnected functions resolves the HubName using a binding expression, while the other does not. When running both projects within the solution, the "SignalRTester" will connect to the function app as a SignalR Hub.

I tried to make this reproduction as simple as possible.

https://github.com/holtalanm/SignalRBindingExpressions.Example

Expected:

Function app should fail on startup, claiming two OnConnected bindings for the same HubName.

-or-

Both OnConnected functions should execute when a SignalR client connects. ??

(You could remove the OnConnected_NoExpressionBinding function if you want -- the OnConnected_ExpressionBinding function never executes, regardless)

Actual:

Only the OnConnected_NoExpressionBinding function executes when a SignalR client connects.

holtalanm commented 3 years ago

Looks like it was never implemented?

https://github.com/Azure/azure-functions-signalrservice-extension/blob/ef7bd21feecf5278c0bcaf487c929a1e5446448e/src/SignalRServiceExtension/TriggerBindings/SignalRTriggerBindingProvider.cs#L60

The property within the SignalRTriggerAttribute is decorated with [AutoResolve], though:

https://github.com/Azure/azure-functions-signalrservice-extension/blob/dev/src/SignalRServiceExtension/TriggerBindings/SignalRTriggerAttribute.cs#L38

Y-Sindo commented 3 years ago

As the fix is released with 1.3.0, close the issue.