Create a Virtual Machine using the Azure Portal
This guide walks you through the process of creating a virtual machine (VM) in Azure using the Azure portal. The Azure portal provides a graphical interface to manage your Azure resources.
Prerequisites
Before you begin, ensure you have:
- An Azure subscription. If you don't have one, you can create a free account.
Steps to Create a VM
Sign in to the Azure portal.
Open a web browser, navigate to https://portal.azure.com/, and sign in with your Azure account credentials.
Create a Virtual Machine.
In the Azure portal, search for "Virtual machines" in the top search bar and select it. Then, click the + Create button and choose Virtual machine.
Configure Basics.
On the Create a virtual machine page, under the Basics tab, configure the following settings:
- 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 (e.g.,
myVM). - Region: Select the Azure region where you want to deploy your VM.
- Availability options: Choose the desired availability options (e.g., Availability set or Availability zone) for high availability. For this example, you can leave it as No infrastructure redundancy required.
- Security type: Select the desired security type (e.g., Standard, Trusted launch virtual machines).
- Image: Select an operating system image. You can choose from various Windows or Linux distributions.
- Size: Choose a VM size that meets your performance and cost requirements. Click See all sizes for more options.
- Administrator account:
- Authentication type: Choose between SSH public key (recommended for Linux) or Password.
- Username: Enter a username for the administrator account (e.g.,
azureuser). - SSH public key source: If using SSH keys, specify the source (e.g., Generate new key pair or Use existing public key).
- Password: If using password authentication, enter and confirm a strong password.
- Inbound port rules:
- Public inbound ports: Select which ports you want to allow inbound traffic from the internet. For Linux, SSH (22) is common. For Windows, RDP (3389) is used.
Configure Disks.
Go to the Disks tab. You can configure the OS disk type (e.g., Premium SSD, Standard SSD, Standard HDD) and add data disks if needed.
- OS disk type: Select the performance tier for your operating system disk.
- Data disks: Click Create and attach a new disk to add additional storage.
Configure Networking.
Go to the Networking tab. Here you can configure the virtual network, subnet, public IP address, and network security group (NSG).
- Virtual network: Choose an existing virtual network or create a new one.
- Subnet: Select a subnet within the virtual network.
- Public IP: Choose whether to create a new public IP address or use an existing one.
- NIC network security group: Select Basic or Advanced. For basic configurations, Basic is sufficient.
- Public inbound ports: This section reiterates the inbound ports configured on the Basics tab. Ensure SSH (22) or RDP (3389) is allowed if you need remote access.
Review and Create.
Go to the Review + create tab. Azure will validate your configuration. Review the summary of your VM settings. If everything looks correct, click the Create button.
Deployment.
The deployment process will begin. This typically takes a few minutes. Once the deployment is complete, you will see a message indicating that your VM is ready.
Connect to your VM.
After the VM is deployed, you can connect to it. Click on the VM name from the deployment confirmation or search for "Virtual machines" and select your VM. On the VM's overview page, you will find the public IP address. Use an SSH client (for Linux) or Remote Desktop Connection (for Windows) to connect using the credentials you provided.
For Linux using SSH:
ssh username@public_ip_address
For Windows using RDP:
Open Remote Desktop Connection, enter the public IP address, and click Connect. Enter your administrator username and password.
Next Steps
- Learn how to manage your virtual machine.
- Explore disk management options.
- Configure network security groups for enhanced security.