azure-signalr icon indicating copy to clipboard operation
azure-signalr copied to clipboard

Frequent lost connections when Blazor Server deployed to Azure ContainerApps

Open sravimohan opened this issue 3 years ago • 5 comments

Describe the bug

Frequent connections issues when connecting from a Blazor Server App deployed to the new Azure ContainerApps. I am using Azure SignalR in standard mode.

[21:33:15 ERR] Failed to connect to '(Primary)https://****.service.signalr.net', will retry after the back off period. Error detail: The server returned status code '403' when status code '101' was expected.. The server returned status code '403' when status code '101' was expected.. Id: 6197cc98

To Reproduce

  • Setup Azure SignalR in Standard Mode
  • deploy Blazor server app configured with Azure SignalR to Azure ContainerApp Service

Exceptions (if any)

[21:33:15 ERR] Failed to connect to '(Primary)https://****.service.signalr.net', will retry after the back off period. Error detail: The server returned status code '403' when status code '101' was expected.. The server returned status code '403' when status code '101' was expected.. Id: 6197cc98

Further technical details

<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="6.0.1" />
<PackageReference Include="Microsoft.Azure.SignalR" Version="1.13.0" />

sravimohan avatar Dec 21 '21 21:12 sravimohan

Please confirm that your connection string is correct. Additionally, did the issue only occur in the Azure Container Apps or it could be reproduced locally?

Y-Sindo avatar Dec 22 '21 06:12 Y-Sindo

Please confirm that your connection string is correct.

yes, can confirm. I am using primary connection string. Also it does work intermittently.

Additionally, did the issue only occur in the Azure Container Apps or it could be reproduced locally?

It seems to work locally and I am not seeing the "Failed to connect to" errors in my local logs.

Additional error logs, https://gist.github.com/sravimohan/d43f45f49a21db069944e035f3ecb417

sravimohan avatar Dec 22 '21 19:12 sravimohan

This doc might help: Troubleshooting methods. You could also send your SignalR resource ID to [email protected] for us to check backend log for you.

Y-Sindo avatar Dec 23 '21 03:12 Y-Sindo

thank you, I will check out the troubleshooting methods. I will email the resource id to you.

sravimohan avatar Dec 23 '21 19:12 sravimohan

yes, can confirm. I am using primary connection string. Also it does work intermittently.

From the logs in the back end, you should be using AAD auth instead of access key. Error code "403" means the app doesn't have the correct role. The strange thing was that 403 only occurred on one IP address. Please confirm all your app instances have the correct role. Hope these information helps you.

Y-Sindo avatar Dec 27 '21 06:12 Y-Sindo