Azure-docs: Question regarding Azure Functions and SignalR

Created on 28 Nov 2019  Â·  8Comments  Â·  Source: MicrosoftDocs/azure-docs

Hello

I have been following this tutorial: https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-quickstart-azure-functions-csharp. SignalR is working quite well in the cloud, and I am able to host a function locally that lets both Unity apps and Xamarin apps connect to it with no issues whatsoever.

I have managed to deploy the Azure Functions app described by the tutorial to the cloud. However, when I open one of them, I get the following error:

"Function (FunctionApp20191128122819/negotiate) Error: Microsoft.Azure.WebJobs.Host: Error indexing method 'negotiate'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'connectionInfo' to type SignalRConnectionInfo. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.)."

Needless to say, I cannot call the functions from anywhere, like I can when I host them locally. Any idea what's wrong? I have tried several versions of Microsoft.NET.Sdk.Functions, except the beta and preview releases.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri3 cxp product-question signalsvc triaged

All 8 comments

@olet88 Thank you for your feedback! We will review and update as appropriate.

@olet88 The SignalR binding requires the Microsoft.Azure.WebJobs.Extensions.SignalRService nuget. Could you try installing that and try again?

Also, you can read more about the SignalR Service binding in the official docs.

@PramodValavala-MSFT This is already installed. :) At least in the Visual Studio solution. The problems arise when I try to host it in Azure.

I have managed to solve the problem. To anyone who encounter something similar, here is a possible solution:

  • Delete all the nuget packages in the project from the folder (C:\users\%username%.nuget\packages). Simply uninstalling them is not enough

  • Reinstall both the latest stable version of Microsoft.Azure.WebJobs.Extensions.SignalRService and Microsoft.NET.Sdk.Functions

  • Delete your old App Service, your old App Service Plan and your old Storage account. Recreate them from Visual Studio

  • Uncheck "Run from package file" when you deploy

Now I can finally connect to it. 😄

@olet88 Thanks for sharing the steps that helped solve your problem!

Also, even with "Run from package file" checked, the exact dependencies defined in your .csproj file should have been bundled. Please feel free to ask your query on StackOverflow or MSDN if you face a similar problem again.

Since there is no doc update required here, we will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

Hey @PramodValavala-MSFT ,
I am getting the exact same error, and cleaning up the resources didn't work for me.
Any other alternate solution to this?

image

Locally the function runs fine but this only occurs on azure portal

I have a similar error and cleaning everything up doesn't help:

Error:

Function (j...functions/Negotiate) Error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Negotiate'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'connectionInfo' to type SignalRConnectionInfo. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
Session Id: 5e21870963f94956aec9fa9218682513

Timestamp: 2020-04-20T22:29:14.758Z

Anything else I can try?

I tried @olet88's solution but it didn't do anything.

But thanks to this blog: https://zimmergren.net/after-upgrading-azure-functions-to-v3-and-you-get-cannot-bind-parameter-log-to-type-ilogger-make-sure-the-parameter-type-is-supported-by-the-binding-and-how-you-can-fix-it/

You "just" have to update the Azure Function project from v2 to v3:

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
</PropertyGroup>

That does the trick, re-published the project, works like a charm.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments

jebeld17 picture jebeld17  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments