Skip to content

Instantly share code, notes, and snippets.

@JosiahSiegel
Created February 2, 2024 14:33
Show Gist options
  • Save JosiahSiegel/abfc8c45f9f565c910d6644df45ba441 to your computer and use it in GitHub Desktop.
Save JosiahSiegel/abfc8c45f9f565c910d6644df45ba441 to your computer and use it in GitHub Desktop.
Azure VM SSH with AAD (Entra)

Login and install ssh extension

az login
az extension add --name ssh

Create 24 hour auth in ssh config

az ssh config --resource-group myResourceGroup --name myVm --file ./sshconfig

Access VM over SSH Options

  1. Connect directly: ssh -F ./sshconfig myResourceGroup-myVM
  2. Use VS Code "Remote Explorer" extension to open in new VSCode instance
    • Make sure config is saved in same config used by VSCode Remote Explorer extension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment