Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Side Blazor breaks on Azure App Service on Linux #10370

Closed
prajaybasu opened this issue May 18, 2019 · 4 comments
Closed

Server Side Blazor breaks on Azure App Service on Linux #10370

prajaybasu opened this issue May 18, 2019 · 4 comments
Labels
area-blazor Includes: Blazor, Razor Components question

Comments

@prajaybasu
Copy link

prajaybasu commented May 18, 2019

Everything (docker images, sdk, etc.) is 3.0 preview 5.

Server Side Blazor breaks on App Service on Linux (Preview) for me due to the following errors in blazor.server.js:

WebSocket connection to 'ws://<redacted>.azurewebsites.net/_blazor?id=<redacted>' failed: Error during WebSocket handshake: Unexpected response code: 503

Error: Failed to start the transport 'WebSockets': null

The application works fine locally (windows or linux container) as well as on App Service (Windows).

I believe this issue is due to App Service on Linux not supporting the permessage-deflate WebSockets extension as documented here.
And it seems like blazor is requesting permessage-deflate according to the request headers (client side):

Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cache-Control: no-cache
Connection: Upgrade
Pragma: no-cache
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Sec-WebSocket-Version: 13
Upgrade: websocket

I have not confirmed if this is really due to permessage-deflate, I will update this issue when I am done testing.
This may not be an issue with ASP.NET Core itself but I believe there needs to be some mitigation logic and/or documentation (ASP.NET Core side) since this deployment scenario is going to become popular sooner or later.

@prajaybasu prajaybasu changed the title Server Side Blazor does not work on App Service on Linux Server Side Blazor breaks on Azure App Service on Linux May 18, 2019
@Eilon Eilon added the area-blazor Includes: Blazor, Razor Components label May 20, 2019
@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @prajaybasu.
In order to use AzureApp service with server-side Blazor, we strongly recommend to use Azure SignalR service, which should automatically take care of this issue.

@mkArtakMSFT
Copy link
Member

mkArtakMSFT commented May 21, 2019

@isaacabraham
Copy link

@mkArtakMSFT what about standard web sockets on App Service i.e. if we aren't using Azure SignalR?

@ezenwankwogabriel
Copy link

I had similar issues on Node. socket.io was failing on App services run on Linux on an azure cdn hosted domain.
Was able to mitigate this by using the Custom Domain and TLS/SSL settings to link my domain to the app service url instead of setting up an azure cdn on the app service.

@ghost ghost locked as resolved and limited conversation to collaborators Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components question
Projects
None yet
Development

No branches or pull requests

5 participants