Does Azure support the use of WebSockets for .NET, if so how can a Websocket connection be initiated and handled?
-
1Have you looked at SignalR for .NET? http://stackoverflow.com/questions/9553432/using-signalr-in-azure-worker-roles – Bart Czernicki Oct 29 '12 at 02:38
-
+1 for signalr, otherwise look at a different approach i've taken http://stackoverflow.com/questions/9177089/running-fleck-or-any-websocket-server-on-windows-azure – cillierscharl Oct 29 '12 at 19:16
3 Answers
Web Sockets are now supported in Azure Web Sites. To use them, go to the site Configuration page in the management portal and turn on Web Sockets.

- 312
- 1
- 3
- 14

- 40,302
- 20
- 199
- 253
-
i have turned on web sockets on azure but i am unable to connect to the websocket using ws://domain.com/ws.ashx.. if i use http:// the link works but ws:// does not work – User7291 Feb 26 '18 at 09:47
At the moment this isn't possible. You'll only get websockets when Azure (Cloud Services or Web Sites) supports .NET 4.5 on Windows Server 2012 (IIS8), which isn't the case at the moment.
Today .NET 4.5 is only available in Web Sites with Windows Server 2008 R2 (IIS7).
Note: Technically you can use other solutions (as opposed to IIS) to get websockets in your Azure application (like Pokein, SuperSocket, ...)

- 24,739
- 2
- 60
- 65
-
Actually, you'll get fallback mode on IIS7 (long polling) which works well enough. – cirrus Oct 28 '12 at 21:56
-
Azure SDK 1.8 is out now with .NET 4.5 support, you can test your code in the emulator...I am sure Azure support will be coming in the next couple of days. http://go.microsoft.com/fwlink/?LinkID=254364 – Bart Czernicki Oct 29 '12 at 02:38
As Sandrino says this is not possible unless you have win8/2012 with .net 4.5. However, that´s if you are running SignalR (or WebSockets in 4.5 of course).
We have been using websockets on Azure for quite some time now, and it is working really well. You can try it at http://live.xsockets.net or our really simple playground http://xfiddle.net
Regards Uffe

- 2,275
- 1
- 13
- 9
-
Have you tried running a solution in the azure emulator? Im asking because im running into a problem right now that when i run the mvc site it works fine but when i run teh azure role from visual studio it times out and do not play well. – Poul K. Sørensen Nov 07 '12 at 21:54