Hi Michael,
I was strugling with making a app that use webscoket protocol to work for the past two months. To test it I created the dummiest possible app to see the websocket working. It is just a push buttom and a progress bar. The environment I was devoping was in my company azure and I am using Python Flask and Vanila JS. Initially I though that something could be wrong in my client JS side so I ask some help from MS. They took my code and made it work. They sent me their code and I tried and got the same connection error. So I deceided to test it with my azure personal account and it worked! I tested my original code and it worked too. So I think that there is some configuration on azure blocking websocket in some way, maybe for security reasons. I didn't find yet what is wrong but I will let you know if a find it out.
Hope this can help you in some way.