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)