Connect to Azure VM w/SSH Through Azure CLI
Adele Beitvashahi

Adele Beitvashahi @adelbeit

About: I like to build stuff. Looking for work 👀 My posts serve as documentation for future me for problems that I encounter and can't find good resources on.

Joined:
Nov 4, 2022

Connect to Azure VM w/SSH Through Azure CLI

Publish Date: Aug 12 '24
7 0

1. Create your VM

2. Assign a public IP to the virtual network/subnet that the VM is under

3. Install azure cli & login:

az login

4. Install ssh extension for azure cli

az extension add --name ssh

5. SSH into vm

az ssh vm --private-key-file \path\to\private\key --resource-group <resource group name> --name <vm name> --local-user <local username (default: 'azureuser')>


FAQ

1. How to get vm/resource names

az vm list -d -o table

2. az login not working on Windows

az login --use-device-code

Comments 0 total

    Add comment