VS Code "Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)" error when connecting to a remote azure ML server

Sarah 0 Reputation points
2025-10-28T21:27:45.21+00:00

User's image

I keep getting this error whenever I attempt to edit my azure ml notebook in VS Code (either desktop or web version). Any help?

Azure Machine Learning
{count} votes

1 answer

Sort by: Most helpful
  1. Manas Mohanty 11,850 Reputation points Microsoft External Staff Moderator
    2025-10-30T11:57:41.43+00:00

    Hi Sarah

    Below issue

    Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)
    Occurs when accessing Azure ML notebooks in VS Code because of following regions.

    • Network restrictions or firewall configurations blocking WebSocket communication.
    • Outdated Azure ML extension in VS Code.
    • DNS resolution on Storage FQDN is not happening

    Check DNS resolution of storage and other FQDN from private endpoint

    nslookup <fqdnofhosturlin DNS records> should resolve to private IPs

    https://free.blessedness.top/en-us/azure/machine-learning/how-to-troubleshoot-secure-connection-workspace?view=azureml-api-2

    Check outbound network settings

    • Allow traffic to:
      • *.vscode.dev
      • raw.githubusercontent.com
        These domains are required for VS Code’s WebSocket communication.

    Verify Networking configuration

    Review Network Security Group (NSG) settings to confirm changes.

    • Use Azure Monitor to validate connectivity to the above domains.

    Firewall and proxy whitelisting

    Please whitelist below VS code URLs

    https://free.blessedness.top/en-us/azure/machine-learning/how-to-access-azureml-behind-firewall?view=azureml-api-2&tabs=ipaddress%2Cpublic#hosts

    Configure firewall ports

    • Ensure ports 8704–8710 are open.
      VS Code server uses these ports dynamically.

    Enable WebSocket communications

    Confirm your network supports WebSocket connections.

    Update Azure AML extension

    • Install the latest version of the Azure Machine Learning extension in VS Code.
    • If outdated, update or reinstall.

    Follow up questions

    • Are you on a private network? Any recent firewall changes?
    • Can you connect to other services, or is it only Azure ML notebooks?
    • Have you tried switching networks (e.g., Wi-Fi → mobile hotspot)?

    Reference

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.