Skip to content

Remote connection to Compute instance issues

FanH edited this page Dec 3, 2025 · 10 revisions

If you are facing issues with the remote connection to Compute instances, please try one of the following:

  • Make sure your network security rules and firewalls are properly setup. Here's the instructions on how to configure NSGs and Firewalls for running different Azure ML Services. You can specifically looks at the hosts used by VSCode here
  • You can also try to run the following commands in your Azure ML terminal to test your connection to the Visual Studio Code CDN:
    1. wget --connect-timeout=7 --dns-timeout=7 -O -v -d vscode-server.tar.gz https://update.code.visualstudio.com/commit:8b3775030ed1a69b13e4f4c628c612102e30a681/server-linux-x64/stable
    2. curl --connect-timeout 7 -L -v https://update.code.visualstudio.com/commit:8b3775030ed1a69b13e4f4c628c612102e30a681/server-linux-x64/stable --output vscode-server.tar.gz -w "%{http_code}"
  • Azure ML - Remote extension uses websockets to communicate between the client and server. To test websockets connection from your local machine to the remote compute instance, please follow the steps below:
    1. Navigate to websocat and download Linux version binary to your Compute Instance. Example: login to your Computer Instance Terminal through Portal and run this command: cd ~ && wget https://github.com/vi/websocat/releases/download/v4.0.0-alpha2/websocat.x86_64-unknown-linux-musl. Note: If the download is blocked by a firewall:
      • Download the binary to your local machine.
      • Upload it to the compute instance via: Machine Learning Portal → Authoring → Notebooks → Add files → Upload files.
    2. In the ML Studio, open a terminal to compute instance and run cd ~ && chmod +x <YOUR_WEBSOCAT_BINARY_NAME> to make downloaded file executable.
    3. On the same terminal from the previous step run ./<YOUR_WEBSOCAT_BINARY_NAME> -s 8705 . If port 8705 is in use, try 8704 or 8703.
    4. Install websocat on your local compute (where your VS code is running). Follow these instructions depending on the OS you have.
    5. Install the Azure CLI on your local compute.
    6. Open a terminal on your local machine and run az login to authenticate the Azure CLI, the tenant that your choose should be the same as the tenant that your Computer Instance you try to connect.
    7. Run az account get-access-token and copy the accessToken property, we will use it later.
    8. Open a terminal on your local machine where we will use Websocat to open a websocket to the compute instance on the port 8705 (or other port you have changed) that we started before.
    9. For non private link workspaces, run the following command: cd <YOUR_LOCAL_MACHINE_WEBSOCAT_DOWNLOAD_FOLDER> && ./<YOUR_LOCAL_WEBSOCAT_BINARY_NAME>.exe wss://<CI-NAME>-8705.<REGION>.instances.azureml.ms/ws --protocol x-ms-proxy#Authorization#Bearer%20<REPLACE-WITH-ACCESS-TOKEN>
    10. For private link workspaces, run the following command: cd <YOUR_LOCAL_MACHINE_WEBSOCAT_DOWNLOAD_FOLDER> && ./<YOUR_LOCAL_WEBSOCAT_BINARY_NAME>.exe wss://<CI-NAME>.<REGION>.instances.azureml.ms:8705/ws --protocol x-ms-proxy#Authorization#Bearer%20<REPLACE-WITH-ACCESS-TOKEN>
    11. If connection is successful you will be able to write something in your local terminal and it should be printed on the compute instance terminal.

If you are getting an error like Unable to install Azure Machine Learning - Remote extension, please retry installing from VS Code Extensions view. Operation timed out.

  • Make sure you are not trying to connect to Compute instance from another remote window like WSL, SSH or Codespaces. You are probably attempting to use what we call Remote in Remote which is not a supported scenario in VSCode. The Azure ML - Remote extension is a UI extension and is not available in the Remote workspace.