Add SSH key to your VM
In the previous step, you generated an SSH key pair. Take the public key and paste it into your VM setup, by copying the entire contents of the
id_rsa.pub. You also want to allow your VM to accept inbound SSH traffic by selecting Allow selected ports and choosing SSH from the Select inbound ports dropdown list.
A cool feature of using Azure VMs is the ability to enable auto-shutdown (because let's face it, we all forget to turn off our VMs…). If you go to the Management tab, you can set the time you want to shut down the VM daily.
Select Review and Create, then Create, and Azure will deploy your VM for you!
Once the deployment is finished (it may take several minutes), go to the new resource view for your virtual machine.
Next, you'll connect to your virtual machine through SSH with Visual Studio Code.