question

PatrickSchneider-6088 avatar image
0 Votes"
PatrickSchneider-6088 asked ·

How to add AzureSignalRConnectionString in Cloud

Hello,

I used the following quickstart tutorial to implement a first Azure Function + SignalR Service.
(https://docs.microsoft.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-functionsazure-signalr-service
image.png (86.4 KiB)
10 |1000 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

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered ·

Hi @PatrickSchneider-6088

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.

· 4 ·
10 |1000 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.

Hey MayankBargali-MSFT,

thank you very much, it works. I am absolutely happy :D

0 Votes 0 ·
MayankBargali-MSFT avatar image MayankBargali-MSFT PatrickSchneider-6088 ·

@PatrickSchneider-6088 Thanks for your feedback and glad to know that the issue is resolved now. Feel free to reach out to us in Microsoft Q&A if you need any assistance in future.

0 Votes 0 ·

@MayankBargali-MSFT just for my deeper understanding, why is the key "AzureSignalRConnectionString". Is that key fix (because i never defined something like that in functions.json, init.py,...) or where is this defined. (If its fix, it isn't a problem though another function in the function app needs another SignalR connection)

0 Votes 0 ·
Show more comments