This page covers the basic setup steps for creating a Linux Virtual Machine (VM) on Microsoft Azure.
8. Select an Image
What is an Image? In Azure, an image is a virtual hard disk (VHD) file used to create a VM. It can include an operating system and pre-installed software.
Key Considerations:
- Operating System: Choose from various Linux distributions such as Ubuntu Server, CentOS, Debian, Red Hat Enterprise Linux (RHEL), SUSE Linux Enterprise Server.
- Version: You can select a specific version of each OS (e.g., Ubuntu 22.04 LTS).
- Marketplace: You can use verified images or images with specific solutions available in the Azure Marketplace.
How to Select:
When starting 'Create a virtual machine' in the Azure Portal, search for and select your desired Linux image in the 'Basics' tab under the 'Image' section.
9. Determine VM Size
What is VM Size? VM size defines the number of virtual CPU cores, memory (RAM), disk capacity, and network bandwidth allocated to your virtual machine. You should choose an appropriate size based on your workload.
Key Considerations:
- B-series (Burstable): e.g., B1s, B2s. Cost-effective and suitable for development/testing environments or light web servers. They can use credits to provide temporary higher performance.
- Dv/Dsv-series (General Purpose): e.g., D4s_v5, D8s_v5. Offers balanced CPU and memory performance, suitable for most workloads.
- Ev/Esv-series (Memory Optimized): e.g., E4s_v5, E8s_v5. Suitable for memory-intensive applications like large databases or in-memory analytics.
How to Choose:
Select the VM size from the 'Size' dropdown menu to match your required computing resources. For initial stages, consider lower specifications like B1s or B2s.
10. Administrator Account: SSH Public Key Setup
What is an SSH Public Key? To securely connect to an Azure Linux VM, using an SSH (Secure Shell) key pair is standard practice. Your private key is kept on your local computer, and the public key is deployed to the Azure VM.
How to Generate:
- Generate new key pair: When creating a VM in the Azure Portal, select the 'Generate new key pair' option and specify a key pair name. The private key will be downloaded automatically.
- Use an existing public key: If you already have an SSH public key, you can paste its content into the Azure Portal to use it.
How to Use:
Use the generated private key file (`*.pem` or `*.ppk`) to connect to your VM via an SSH client. This key is associated with the administrator user of the VM (default: `azureuser` or your specified name).
chmod 400 your_private_key.pem ssh -i "your_private_key.pem" your_admin_username@YOUR_VM_PUBLIC_IP
11. Select a Region
What is a Region? An Azure region is a specific geographical location where Azure data centers are physically located. When creating a VM, you must select the region where the VM will be deployed.
Key Considerations:
- Proximity to Users: Choose a region closer to your users to reduce network latency.
- Compliance: Data residency and compliance requirements may dictate that data must be stored in specific regions.
- Cost and Availability Zones: Resource costs can vary by region, and support for Availability Zones should also be considered.
How to Select:
Select your desired region from the 'Region' dropdown menu in the 'Basics' tab. For example, you might choose 'Korea Central' or 'East US'.