DEV Community

Adele Beitvashahi
Adele Beitvashahi

Posted on • Edited on

6

Connect to Azure VM w/SSH Through Azure CLI

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

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay