Here's how to create a VM on Azure.
The most basic condition for creating a virtual machine is to prepare a boot disk file for the system disk for the virtual machine. There are two types of template files: one is a image that we are very familiar with, and the other is a VHD (virtual disk) file.
Therefore, there are two ways to create a VM: image-based creation and system-based disk creation.
# Image-based Creation
Log in to the Azure Portal and open: VM -> Create a virtual machine
Select the appropriate image when creating the VM (this is the most important step)
Image sources are: official image, Marketplace image and Customized image. If you use the customized image source, the disk can only choose the hosting mode.
Set the account password, network, security group, etc.
"Review + create" after you pass, click "Next"
# VHD Creation
- Log in Azure Portal, click "All Resources", find a disk that has been unattached
- Click the "Create VM"
- Set the account password, network, security group, etc.
- "Review + create" after you pass, click "Next"
# SSH Key
When creating a VM, some users prefer to use the SSH key pair as the login credentials.
Since Azure needs to provide its own SSH public key, it requires the user to prepare in advance.
Take PUTTYGEN (KEY GENERATOR FOR PUTTY ON WINDOWS) as an example to illustrate how to create an SSH public key.
Download and Install PUTTYGEN (opens new window).
Public key and Private key is OK, you can copy public to Azure(format starting with "ssh-rsa") ,and Save the public key and private key on your local computer for backups
When connect Linux on your local computer, you can use private key for authentication