An Azure machine learning service for building and deploying models.
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
- 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.
- 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.
- 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
Thank you!