Trade-offs when using WebSockets over Azure App Service?

Viewed 141

I was surprised that support for WebSockets is by default disabled in Azure App Service. Before you can use it, you have to enable the setting (Configuration -> Settings -> Web sockets).

The support for WebSockets was added in 2013 when the service was still called Azure Web Sites. So, it is not an experimental feature anymore. Given that WebSockets are an established web standard, I would have expected it to be supported out-of-the-box in 2021.

My assumption is that Microsoft has its reasons why they leave it opt-in. It would be interesting to understand the trade-offs of supporting WebSockets in a setup like Azure App Service (or AWS Elastic Beanstalk):

  • Is it because of security reasons? (Not that I could think of any, but I might overlook something)
  • Does it introduce problems for the load balancer? (WebSocket is stateful and not proxy-friendly, in contrast to standard HTTP)
  • Does it impact aspects like how long TCP connections can last? (Making it harder to detect broken connections)
1 Answers

IMHO, it's disabled by default as most apps won't need it. I also think your assumptions are correct, unless you use App Service Environment which will create a separated and dedicated cluster for you, it may affect other apps running from other customers. But those are just assumptions, the best we can do is await and check if one of the Microsoft's PM will answer this. Also, try to reach them out on Twitter and sharing the link with them.

Related