Share via

VS Code Desktop from Azure ML Studio: Change default Explorer/Terminal Directory

BeatriceHammond-9974 10 Reputation points
2026-03-26T15:26:35.16+00:00

For local development, our data scientists and engineers use ~/localfiles/ rather than cloudfiles and have to change from cloudfiles to localfiles, open a new window or workspace every time they connect via VS Code Desktop from Azure ML Studio. Is there a way to change the default path from the session so that the Explorer and Terminal both open at localfiles instead of ~/cloudfiles/code/Users/<username>? Is there a way to do this maybe with a start up script etc?

Expected Behaviour Team clicks "Edit in VS Code (Desktop)" from AML Studio → VS Code opens with:

Explorer rooted at ~/localfiles/ (local disk on compute instance)

New Terminal starts in ~/localfiles/

No manual File→Open Folder or cd ~/localfiles && code . required each session

Current Behavior Always opens in ~/cloudfiles/code/Users/<username> (workspace file share mount). Team must manually switch workspace/terminal location every connection.

We'd also like to change it only for Vscode desktop and leave the jupyter notebooks in cloudfiles

Azure Machine Learning

2 answers

Sort by: Most helpful
  1. Anshika Varshney 9,740 Reputation points Microsoft External Staff Moderator
    2026-03-26T18:26:58.8066667+00:00

    Hello BeatriceHammond-9974,

    Azure ML Studio pins the VS Code workspace root to the cloudfiles directory as part of its managed environment. Startup scripts can change the terminal directory, but not the Explorer root because that is defined when VS Code is launched. Currently, there is no supported way to change the default Explorer path for VS Code Desktop sessions initiated from AML Studio. The only workarounds are manually opening the folder or using symlinks.

    When Edit in VS Code (Desktop) is launched from Azure Machine Learning Studio, the VS Code session opens with the Explorer rooted under

    ~/cloudfiles/code/Users/<username>
    

    The Studio launch experience opens VS Code Desktop with a predefined workspace that is backed by the workspace file share. This workspace root is determined at launch time and cannot be changed through startup scripts or shell configuration.

    This occurs as

    1. Managed workspace launch model - The Studio experience launches VS Code Desktop through a managed remote session that is preconfigured to open the workspace-backed file area. This location is persistent across sessions and integrates with notebooks, experiments, and jobs.
    2. Difference between cloudfiles and localfiles

    Compute instances expose two commonly used locations:

    • cloudfiles
      • Backed by workspace storage
      • Persistent and shared
      • Used by Studio and VS Code launch flow
    • localfiles
      • Stored on the compute instance local disk
      • Faster for I/O
      • Tied to the lifecycle of the compute instance

    Terminal behavior vs Explorer behavior - startup scripts successfully change the terminal directory while the Explorer remains unchanged.

    • Integrated Terminal
      • Controlled by shell initialization and VS Code settings
      • Can start in a custom directory
    • Explorer pane
      • Controlled by the workspace root passed when VS Code is launched
      • Cannot be changed by shell scripts

    Please check the following workarounds

    1:.Default terminal to localfiles -configure the terminal to start in localfiles:

    Option A – Shell configuration

    if [ "$TERM_PROGRAM" = "vscode" ]; then
      cd ~/localfiles
    fi
    

    Option B – VS Code setting

    "terminal.integrated.cwd": "/home/azureuser/localfiles"
    

    This ensures all new terminals start in localfiles, while keeping the Studio launch flow unchanged.

    1. Use a VS Code workspace file to re-root Explorer

    A workspace file can re-root the Explorer after the connection is established.

    Example .code-workspace file:

    {
      "folders": [
        { "path": "/home/azureuser/localfiles" }
      ],
      "settings": {
        "terminal.integrated.cwd": "${workspaceFolder}"
      }
    }
    

    3.Symlink localfiles into the workspace

    ln -s ~/localfiles ~/cloudfiles/code/Users/<username>/localfiles
    

    4.Alternate connection method

    Connecting through Remote‑SSH allows full control of the starting directory but bypasses the Studio launcher and is not equivalent to Edit in VS Code (Desktop)

    References:

    What is an Azure Machine Learning compute instance? - Azure Machine Learning | Microsoft Learn

    Terminal Basics

    What is a VS Code workspace?

    Remote Development using SSH

    Thank you!

    1 person found this answer helpful.

  2. Yutaka_K_JP 1,655 Reputation points
    2026-03-28T07:04:16.8433333+00:00

    I think the only way is a tiny server-env-setup that cd’s u into ~/localfiles, since aml hard‑pins the vscode root — if it still won’t move, regen the server or fix perms or drop a symlink. 


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.