question

mrli-7807 avatar image
0 Votes"
mrli-7807 asked Grmacjon-MSFT answered

How to link SignalR service with Azure Serveless Functions - Deploy from Visual Studio for Mac?

While I am replicating the sample app described in this link , to make use of SignalR service with Azure functions since I am new to both. The steps given in the doc/link seems to be outdated.

I have followed step by step but stuck at one point where the Azure Functions need to be published from Visual Studio by linking the SignalR service. The doc says to choose Edit Azure App Service Settings to link the SignalR service Connection string. I don't see any such option. Also I use Visual Studio for Mac for dev & publishing the Azure Functions.

Can you please help me in linking the Azure Functions with SignalR service?

PS: Azure functions are deployed successfully with out SignalR link, when I try to access any of the functions I get 500: Internal Server Exception

azure-functionsazure-signalr-service
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Grmacjon-MSFT avatar image
0 Votes"
Grmacjon-MSFT answered

Hi @mrli-7807 ,


Thanks for your patience. I looked at the documentation you were following and it looks like some of the screen shots in the tutorial are outdated. Please see this documentation " Quickstart: Create a chat room with Azure Functions and SignalR Service using C#" to see how to link the Azure Functions with SignalR service.


Here are the steps the doc provides to configure and run the Azure Function app with SignalR service:


1.Start Visual Studio (or another code editor) and open the solution in the src/chat/csharp folder of the cloned repository.
2. In the browser where the Azure portal is opened, confirm the SignalR Service instance you deployed earlier was successfully created by searching for its name in the search box at the top of the portal. Select the instance to open it.
3. Select Keys to view the connection strings for the SignalR Service instance.
4. Select and copy the primary connection string.
5. Back in Visual Studio, in Solution Explorer, rename local.settings.sample.json to local.settings.json.
6. In local.settings.json, paste the connection string into the value of the AzureSignalRConnectionString setting. Save the file.
7. Open Functions.cs. There are two HTTP triggered functions in this function app:
- GetSignalRInfo - Uses the SignalRConnectionInfo input binding to generate and return valid connection information.
- SendMessage - Receives a chat message in the request body and uses the SignalR output binding to broadcast the message to all connected client applications.
10. Use one of the following options to start the Azure Function app locally.
11. Visual Studio: In the Debug menu, select Start debugging to run the application.


You can also view this doc for additional information on SignalR Service bindings for Azure Functions


Hope that helps. Please let us know if you have further questions.


Thanks,


Grace


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.