Skip to content

Remote connection to Compute instance issues

FanH edited this page Feb 24, 2025 · 7 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. Install websocat on your compute instance. In the ML Studio, open a terminal to compute instance and run cd /home sudo wget https://github.com/vi/websocat/releases/download/v1.11.0/websocat.x86_64-unknown-linux-musl
  2. On the same terminal from the previous step run /home/websocat.x86_64-unknown-linux-musl -s 8705
  3. Install websocat on your local compute (where your VS code is running). Follow these instructions depending on the OS you have.
  4. Install the Azure CLI on your local compute.
  5. Open a terminal on your local machine and run az login to authenticate the Azure CLI.
  6. Run az account get-access-token and copy the accessToken property, we will use it later.
  7. Open a terminal on your local machine where we will use websocat to open a websocket to the compute instance on the port 8705 that we started before.
  8. For non private link workspaces, run the following command: ./websocat_win64.exe wss://<CI-NAME>-8705.<REGION>.instances.azureml.ms/ws --protocol x-ms-proxy#Authorization#Bearer%20<REPLACE-WITH-ACCESS-TOKEN>
  9. For private link workspaces, run the following command: ./websocat_win64.exe wss://<CI-NAME>.<REGION>.instances.azureml.ms:8705/ws --protocol x-ms-proxy#Authorization#Bearer%20<REPLACE-WITH-ACCESS-TOKEN>
  10. 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.