3

I have deployed a docker image to an azure container instance. i am attempting to access the container console via settings>containers>connect.

enter image description here

I receive the following error:

screenshot

The following web socket error occurred: error: Web socket is closed or could not be opened... Please validate your network connection and retry the attempt.

I can successfully connect to my container via

az container exec --resource-group myRG --name myContainer --exec-command "/bin/bash"

Joy
  • 1,171
  • 9
  • 15
Stephen
  • 95
  • 2
  • 6

1 Answers1

1

I was having the same issue, ended up being a corporate firewall issue, non-standard ports are blocked by default, included SSH ports.

At my company, might be different depending our your network.

mumrahte
  • 21
  • 4
  • The connection is not originating from OP network. – Mike L'Angelo Aug 19 '21 at 15:56
  • 1
    The web browser isn't connecting directly via azure, it still has to use your local connection if your on a VPN that will be the pipe, our workplace blocks pretty much all ports outside of 8080/80/443 I think, as soon as I dropped off the vpn I could both connect to the azure container running docker that was running a service and it responded as I expected, and I was able to SSH via the connect dialog. Was a lightbulb moment so I had to have our security team open the port and it worked as expected on the VPN. – mumrahte Aug 20 '21 at 19:46
  • Yes, correct, I had a brain fart. Point is that websocket protocol uses TCP 80/443 outgoing to communicate, so that's usually open. Besides, the OP can browse the portal.azure.com so 443 outgoing should be open already (unless a firewall is blocking a specific range of IPs) – Mike L'Angelo Aug 21 '21 at 10:13
  • Once again unsure, but I had the exact error the OP had and I could not actually ping my docker instance running a service, until I dropped off my works VPN, everything else was correct. Not sure that's always the case, but I couldn't find any actual working answers, and this worked for me, It might help someone else, considering the OP asked this 2 years ago, I doubt they care any more. – mumrahte Aug 25 '21 at 14:34