How to add AzureSignalRConnectionString in Cloud

Patrick Schneider 86 Reputation points
2021-03-15T10:23:04.63+00:00

Hello,

I used the following quickstart tutorial to implement a first Azure Function + SignalR Service.
(https://video2.skills-academy.com/en-us/azure/azure-signalr/signalr-quickstart-azure-functions-python)

My preferred language is python. After the tutorial i tried to push the code to cloud.

Locally the code works (=> "AzureSignalRConnectionString" in local.settings.json),
but in the cloud each request fails. With the error:
"The SignalR Service connection string must be set either via an 'AzureSignalRConnectionString' app setting, via an 'AzureSignalRConnectionString' environment variable, or directly in code via SignalROptions.ConnectionString or SignalRAttribute.ConnectionStringSetting."

I cleary understand, that i have to add the AzureSignalRConnectionString from the local.settings.json. But i have no idea where!?!

In my Azure Function App i added a new Application setting. I named it "AzureSignalRConnection" an pasted the Connection String from the local.settings.json file. But it still doesn´t work.

77733-image.png

Is there something else to add than just this application setting (For example add a reference to this new application setting)? Or where is the correct place to add the Connection-String?

Or principal... what is the correct way to go?

With best regards Patrick

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,978 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
142 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,421 Reputation points
    2021-03-15T11:47:29.657+00:00

    Hi @Patrick Schneider

    You need to define the key as "AzureSignalRConnectionString" instead of "AzureSignalRConnection" if you are defining it in the application settings.
    As per the article it defines the AzureSignalRConnectionString in local.settings.json. This setting (inside local.setting.json) is only for your local environment. Once you deploy your function you need to copy every setting in local.settings.json to the application settings of your function app.

    Hope the above helps you to resolve the issue. Please let me know if you need any assistance.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.