Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure Linux for Virtual Machines provides a Microsoft-supported, Azure-optimized Linux distribution for scalable web apps, infrastructure services, and AI workloads. It integrates natively with Azure services, extensions, and tooling, and includes Microsoft-managed security response and lifecycle support. For more information, see Azure Linux for Virtual Machines.
In this quickstart, you learn how to:
- Create an Azure Linux 4.0 VM in the Azure portal.
- Configure SSH access and inbound port rules.
- Connect to the VM over SSH.
- Clean up resources.
Note
Azure Linux 4.0 is now in preview and is strictly limited to evaluation and testing purposes. It's not suitable for production use.
Prerequisites
- An Azure subscription. If you don't have one, create a free account before you begin.
Create a virtual machine
- Sign in to the Azure portal.
- Search for Virtual machines and select Create > Virtual machine.
Configure the Basics tab
Under Project details, select your Subscription and create a new Resource group named
myResourceGroup.Under Instance details, configure the following settings:
Setting Value VM name myVMAvailability options No infrastructure redundancy required Security type Standard Image Azure Linux 4.0 Size Use defaults (varies by region) Under Administrator account, configure the following settings:
Setting Value Authentication type SSH public key Username azureuserSSH key source Generate new key pair Key pair name myKeyUnder Inbound port rules, set Public inbound ports to Allow selected ports and select SSH (22) and HTTP (80).
Select Review + create > Create.
Download the SSH key
When prompted, select Download private key and create resource and save the myKey.pem file to an accessible location.
Get the public IP address of the VM
- After deployment completes, select Go to resource.
- On the VM's Overview page, copy the Public IP address.
Connect to the VM
Set permissions on the key file (macOS/Linux):
chmod 400 ~/Downloads/myKey.pemSSH into the VM. Replace
<PUBLIC_IP>with the IP address you copied:ssh -i ~/Downloads/myKey.pem azureuser@<PUBLIC_IP>Tip
You can reuse this SSH key for future VMs by selecting Use a key stored in Azure when creating a new VM.
Clean up resources
When you no longer need the VM, delete the resource group to remove all associated resources using the following steps:
- Open the Overview page for the VM in the Azure portal.
- Select the Resource group link.
- Select Delete resource group.
- Enter the resource group name to confirm, and then select Delete.
Tip
To avoid charges without deleting the VM, you can enable Auto-shutdown under Operations > Auto-shutdown on the VM page in the portal.
Related content
For more information about Azure Linux, see the following resources: