Create a Virtual Machine
This guide will walk you through the steps to create a new Virtual Machine (VM) in Azure. You can create VMs using the Azure portal, Azure CLI, Azure PowerShell, or ARM templates.
Using the Azure Portal
The Azure portal provides a user-friendly graphical interface for creating and managing Azure resources.
Steps:
- Sign in to the Azure portal: Navigate to https://portal.azure.com/ and sign in with your Azure account.
- Navigate to Virtual Machines: In the portal's search bar, type "Virtual machines" and select "Virtual machines" from the results.
- Create a Virtual Machine: Click the + Create button and select Virtual machine.
- Basics Tab:
- Subscription: Select your Azure subscription.
- Resource group: Choose an existing resource group or click Create new to create a new one. A resource group is a logical container for your Azure resources.
- Virtual machine name: Enter a unique name for your VM.
- Region: Select the Azure region where you want to deploy your VM.
- Availability options: Choose your desired availability options (e.g., Availability zone, Availability set).
- Security type: Select the desired security type (Standard, Trusted launch, Confidential).
- Image: Choose an operating system image (e.g., Windows Server, Ubuntu Server).
- Size: Select a VM size that meets your performance and cost requirements.
- Administrator account: Configure username and password or SSH public key authentication.
- Inbound port rules: Select the ports you want to allow inbound traffic to (e.g., RDP (3389) for Windows, SSH (22) for Linux).
- Disks Tab: Configure the OS disk and data disks for your VM. You can choose between different disk types (e.g., Premium SSD, Standard SSD, Standard HDD).
- Networking Tab: Configure the virtual network, subnet, public IP address, and network security group for your VM.
- Management Tab: Configure monitoring, identity, auto-shutdown, and other management settings.
- Advanced Tab: Configure extensions, custom data, and other advanced settings.
- Tags Tab: Apply tags to your VM for organization and billing purposes.
- Review + create: Review all your settings. If everything is correct, click Create.
Note: The deployment process can take a few minutes to complete. You will receive a notification once the VM is successfully deployed.
Example using Azure CLI
You can also create a VM using the Azure Command-Line Interface (CLI). Ensure you have the Azure CLI installed and logged in to your Azure account.
az vm create \
--resource-group MyResourceGroup \
--name MyVM \
--image UbuntuLTS \
--admin-username azureuser \
--generate-ssh-keys
Tip: For more advanced configurations, refer to the Azure CLI documentation for
az vm create.