Skip to content

urbanantics/signalr-container-issue

Repository files navigation

signalr-container-issue

Describe the bug

Azure Signalr Service running on ASP.NET Core within a container fails to connect with 401

To Reproduce

Sample code and instructions to reproduce: https://github.com/urbanantics/signalr-container-issue

The code in this repo was created based on the Microsoft Azure Signalr quickstart https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-quickstart-dotnet-core

Ensure you have docker installed

Note: To keep thigs simple, this example uses http website connection, I have tried setting up the website to accept https connections but still get the same error

  1. Find and replace the following with an actual connection string from Azure Signalr service:
"ConnectionString": "<signalr service connection string>"
  1. Compile and run the code using:
dotnet run
  1. Now create and run the chat app from inside a docker container with a volume pointing the same folder:
docker run -it `
    -p 8000:5000 `
    -w /src `
    -v "${PWD}:/src/" `
    --entrypoint /bin/bash mcr.microsoft.com/dotnet/sdk:5.0-buster-slim 

dotnet run
  • visit http://localhost:8000
  • you will see again the standard quickstart chat app
  • however the chat app does not work, from the logs you see the following errors

Exceptions (if any)

fail: Microsoft.Azure.SignalR.ServiceConnection[2] Failed to connect to '(Primary)https://.service.signalr.net', will retry after the back off period. Error detail: The server returned status code '401' when status code '101' was expected.. The server returned status code '401' when status code '101' was expected.. Id: f02b28df-566d-4dac-908f-8489750e8a76

Further technical details

net5.0 chat_app

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •