Deploying a Virtual Machine (VM) in Microsoft Azure is one of the first steps you’ll likely take when working with Azure. Whether you're testing out an application, hosting a website, or running a service, Azure VMs allow you to run your operating system (Windows or Linux) and applications in the cloud.
In this guide, we'll walk you through the process of deploying your very first VM in Azure using the Azure Portal.
Prerequisites:
Before deploying your first VM in Azure, make sure you have:
An Azure account. If you don’t have one, you can sign up for a free account at Azure's official site.
Azure Portal access. You'll be using the Azure Portal to create and manage your VM.
A basic understanding of virtual machines and cloud concepts.
Step 1: Sign in to the Azure Portal
Go to the Azure Portal.
Log in with your copyright (the one you used to create your Azure account).
Step 2: Create a Resource Group
Before creating your VM, you need to organize it within a resource group. A resource group acts as a container for resources that share the same lifecycle.
In the Azure Portal, search for Resource Groups in the search bar.
Click on Create.
Fill in the required fields:
Subscription: Choose your active subscription.
Resource Group Name: Choose a name for your resource group (e.g.,
myVMResourceGroup
).
Region: Select the region where your resources will be stored (e.g., East US).
Click Review + Create and then click Create.
Step 3: Create the Virtual Machine
Now it’s time to create your first VM!
Search for Virtual Machines in the search bar at the top of the Azure Portal.
Select Virtual Machines and then click Create > Virtual Machine.
Step 4: Configure Your VM
Now, you’ll be prompted to configure the settings for your VM.
Subscription: Choose your subscription.
Resource Group: Select the resource group you created in Step 2.
Virtual Machine Name: Enter a name for your VM (e.g.,
MyFirstVM
).
Region: Select the region where you want to deploy your VM (same as the resource group’s region).
Availability Options: Leave as No infrastructure redundancy required unless you need more advanced options like high availability.
Image: Select the operating system you want to run. For beginners, Windows Server 2022 or Ubuntu is recommended.
Size: Choose the size for your VM based on your performance needs. For testing purposes, select the B1s (1 vCPU, 1 GB RAM) size, which is suitable for small workloads and cost-effective.
Authentication Type: Choose either Password or SSH public key for authentication.
For Windows VMs, choose Password and set an Admin Username and Password.
For Linux VMs, choose SSH public key and upload your SSH public key.
Public IP: Keep it Enabled if you want the VM to be accessible from the internet. This is useful for testing or web hosting.
NIC network settings: Leave the defaults unless you need to set up specific configurations for a more complex network.
After filling in these settings, click Next: Disks.
Step 5: Configure Disks
In this section, you can choose the disk type and configuration for your VM:
OS Disk Type: You can choose between Standard SSD (lower cost) or Premium SSD (higher performance). For most beginners, Standard SSD is sufficient.
Data Disks: You can add additional data disks if required (not necessary for simple tests).
Click Next: Networking.
Step 6: Configure Networking
Here, you can configure the network settings for your VM:
Virtual Network: Choose the default network if you're unsure, or create a new one.
Subnet: Select the default subnet or create a new one.
Public IP: Choose Enabled if you want the VM to be accessible from the public internet (useful for web apps).
NIC Network Security Group: For security, choose Basic and allow SSH (Linux) or RDP (Windows) access.
Click Next: Management.
Step 7: Configure Management Settings
In this section, you can configure monitoring and management options. The default settings are typically fine for a basic VM:
Monitoring: Enable Boot Diagnostics for troubleshooting and OS Guest Diagnostics if required.
Identity and Availability: Leave the settings as they are unless you need specific identity or availability configurations.
Click Next: Advanced.
Step 8: Configure Advanced Settings (Optional)
Advanced settings allow you to configure things like extensions, custom scripts, and more. For most beginners, these options can be skipped.
Click Next: Tags.
Step 9: Add Tags (Optional)
Tags are helpful for organizing and managing resources within your subscription. You can add tags here (e.g., Environment:Test
) or skip this step.
Click Next: Review + Create.
Step 10: Review and Create
You’ll now see a summary of all your VM settings. Review everything to make sure it’s correct.
If everything looks good, click Create to deploy your VM.
Azure will now begin creating the VM. The deployment process will take a few minutes.
Step 11: Access Your Virtual Machine
Once the deployment is complete:
Go to the Virtual Machines section in the Azure Portal.
Click on your newly created VM.
If it’s a Windows VM, click on Connect and use Remote Desktop Protocol (RDP) to connect to your VM using the public IP address and the admin username/password you set earlier.
If it’s a Linux VM, use SSH to connect to the VM with the public IP and your SSH key.
Conclusion
Congratulations! You’ve just deployed your first Virtual Machine in Azure. From here, you can start installing software, hosting applications, or experimenting with cloud-based services.
Azure VMs are a flexible and cost-effective way to run your workloads, and they offer scalability as your needs grow. Explore more Azure features like scaling, backups, and security to enhance your cloud infrastructure.
start you career in data analytics with azuretrainings's azure data engineer training in hyderabad