A VS Code extension that connects to Azure Virtual Machines over SSH using
the Azure CLI's az ssh
command and opens them with Remote - SSH, so you can edit and run code on the
remote VM directly from your IDE.
How it works
You pick a subscription and a VM from a Quick Pick list (az vm list).
The extension runs az ssh config to generate a per-VM SSH config file plus a
short-lived Microsoft Entra SSH certificate.
It adds an Include line to your ~/.ssh/config pointing at the generated file.
It asks the Remote - SSH extension to open a window connected to that host.
Because the certificate is regenerated (with --overwrite) every time you
connect, you always start with a fresh, valid credential.
Requirements
Azure CLI (az)
on your PATH, with the ssh extension (az extension add --name ssh).
The Remote - SSH
extension (installed automatically as a dependency).
For Microsoft Entra login: the target VM must have the AAD login extension
installed and you need the Virtual Machine Administrator/User Login role.
Commands
Command
Description
Azure VM SSH: Connect to VM (new window)
Pick a VM and open it in a new Remote-SSH window.
Azure VM SSH: Connect to VM (current window)
Same, but reuse the current window.
Azure VM SSH: Sign in to Azure (az login)
Run az login.
Azure VM SSH: Select Azure Subscription
Switch the active subscription.
Settings
Setting
Description
azureVmSsh.sshConfigDir
Where per-VM config + certs are written (default ~/.ssh/az-ssh).
azureVmSsh.privateKeyFile
Private key path for local-user VMs (not Entra).
azureVmSsh.localUser
Local user name to use with privateKeyFile.
Develop / run locally
npm install
npm run compile
Then press F5 ("Run Extension") to launch an Extension Development Host,
and run one of the commands from the Command Palette.