HSR Sector 6 · Bangalore +91 96110 27980 Mon–Sat · 09:30–20:30
Chapter 3 of 20 — Azure Cloud Fundamentals
beginner Chapter 3 of 20

Azure Virtual Machines — Compute Basics, Sizing & Deployment

By Vikas Swami, CCIE #22239 | Updated Mar 2026 | Free Course

What are Azure Virtual Machines — IaaS Compute Explained

Azure virtual machines (Azure virtual machines) are scalable, on-demand computing resources provided by Microsoft Azure's Infrastructure as a Service (IaaS) platform. They enable organizations and developers to run applications, host websites, and develop complex solutions without investing in physical hardware. Unlike traditional on-premises servers, Azure VMs offer flexibility, rapid deployment, and a pay-as-you-go model, making them ideal for dynamic workloads, testing environments, and disaster recovery.

Azure VMs are essentially virtualized hardware instances that run on Microsoft's global data center infrastructure. They provide virtualized CPU, memory, storage, and networking, allowing users to configure and deploy virtual servers tailored to specific needs. This abstraction enables rapid scaling, easy management, and integration with other Azure services like networks, databases, and security tools.

Understanding Azure compute services begins with recognizing that Azure VMs are just one component within the broader Azure ecosystem, which includes container services, app services, and serverless options. However, VMs remain the backbone for many traditional and legacy workloads that require full control over the operating system and environment. For beginners, grasping how Azure VMs operate, their deployment options, and management practices is essential to leveraging cloud infrastructure effectively. As Bangalore's leading IT training institute, Networkers Home offers comprehensive courses that cover Azure virtual machines in detail, helping learners develop practical skills in cloud computing.

VM Series and Sizes — General Purpose, Compute, Memory & GPU Optimized

Azure virtual machines come in various series and sizes designed to meet diverse workload requirements. Selecting the appropriate VM size is crucial for optimizing performance, cost, and scalability. Azure categorizes VM sizes into several series, including General Purpose, Compute Optimized, Memory Optimized, Storage Optimized, GPU, and High Performance Computing (HPC). Understanding these categories helps in choosing the right VM for your workload.

General Purpose (D-series, B-series): These VM sizes balance CPU, memory, and storage, making them suitable for development, testing, small to medium databases, and web servers. For example, the Standard_D2s_v3 offers 2 vCPUs and 8 GB RAM, ideal for general workloads.

Compute Optimized (F-series): Focused on CPU performance, these VMs are suitable for batch processing, gaming servers, and analytics. The Standard_F4s_v2 provides 4 vCPUs with moderate memory.

Memory Optimized (E-series, M-series): Designed for large in-memory databases and analytics, these VMs offer high RAM per vCPU. For instance, Standard_E8s_v4 provides 8 vCPUs with 64 GB RAM.

GPU-Optimized (NV, NC, ND-series): These VMs are tailored for graphics rendering, machine learning, and high-performance computing. An example is Standard_NC6 with 6 vCPUs, 56 GB RAM, and GPU capabilities.

Below is a comparison table summarizing key VM series:

Series Main Use Cases Example VM Size vCPUs Memory (GB) Special Features
General Purpose Web servers, small databases Standard_D2s_v3 2 8 Balanced CPU and RAM
Compute Optimized Batch processing, analytics Standard_F4s_v2 4 8 High CPU performance
Memory Optimized Large databases, in-memory caching Standard_E8s_v4 8 64 High RAM per vCPU
GPU-Optimized AI, ML, rendering Standard_NC6 6 56 GPU acceleration

Choosing the right VM size involves analyzing workload requirements, cost considerations, and future scalability. Azure's flexibility allows easy resizing of VMs as needs evolve, which is particularly beneficial for startups and enterprises alike. For in-depth understanding and hands-on practice, aspiring networkers and cloud administrators can refer to courses at Networkers Home.

Creating a Virtual Machine — Portal, CLI & Template Methods

Deploying an Azure virtual machine can be accomplished through various methods, including the Azure Portal, Azure CLI, and Infrastructure as Code (IaC) templates. Each approach caters to different user preferences, whether graphical interface, command-line automation, or code-driven deployment.

Using Azure Portal

The Azure Portal provides a user-friendly graphical interface for VM deployment. To create a VM, log in to the portal, navigate to the "Virtual Machines" section, and click on "Create." The wizard guides you through essential configurations:

  • Basics: Subscription, Resource Group, VM Name, Region
  • Image: Select from marketplace images or custom images
  • Size: Choose VM size based on compute requirements
  • Authentication: Setup SSH keys or password
  • Disks: Configure OS disk type and data disks
  • Networking: Assign virtual network, subnet, public IP, and security groups

Once configured, review settings and click "Create" to deploy the VM. This method is ideal for beginners or quick testing scenarios.

Using Azure CLI

The Azure Command-Line Interface (CLI) offers automation and scripting capabilities for deploying VMs. Example commands to deploy a Linux VM:

az login
az group create --name MyResourceGroup --location eastus
az vm create --resource-group MyResourceGroup --name MyVM --image UbuntuLTS --size Standard_D2s_v3 --admin-username azureuser --generate-ssh-keys

This method is efficient for repeatable deployments, CI/CD pipelines, or managing multiple resources programmatically. Azure CLI is cross-platform and can be integrated into scripts or development workflows.

Using ARM Templates

Azure Resource Manager (ARM) templates provide Infrastructure as Code (IaC) for deploying VMs with predefined configurations. A typical ARM template includes JSON definitions for VM size, image, network interfaces, and disks. Example snippet:

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json",
  "contentVersion": "1.0.0.0",
  "resources": [
    {
      "type": "Microsoft.Compute/virtualMachines",
      "apiVersion": "2021-07-01",
      "name": "MyVM",
      "location": "eastus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D2s_v3"
        },
        "storageProfile": {
          "imageReference": {
            "publisher": "Canonical",
            "offer": "UbuntuServer",
            "sku": "18.04-LTS",
            "version": "latest"
          }
        },
        "osProfile": {
          "computerName": "MyVM",
          "adminUsername": "azureuser",
          "linuxConfiguration": {
            "disablePasswordAuthentication": true,
            "ssh": {
              "publicKeys": [
                {
                  "path": "/home/azureuser/.ssh/authorized_keys",
                  "keyData": ""
                }
              ]
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "[resourceId('Microsoft.Network/networkInterfaces', 'MyNIC')]"
            }
          ]
        }
      }
    }
  ]
}

Deploying through ARM templates enables version control, repeatability, and validation of infrastructure configurations, vital for enterprise-scale deployments.

VM Images — Marketplace, Custom Images & Shared Image Gallery

Choosing the right VM image is fundamental to deploying Azure virtual machines. Azure offers several options for images, including marketplace images, custom images, and Shared Image Gallery, each suited for different scenarios.

Azure Marketplace Images

The Azure Marketplace hosts a vast array of pre-configured images from Microsoft, third-party vendors, and open-source communities. These images include popular Linux distributions (Ubuntu, CentOS, Red Hat), Windows Server versions, and specialized solutions like SQL Server, SAP, and more. Deploying a VM from Marketplace images is straightforward via the portal, CLI, or ARM templates.

Custom Images

Custom images are created from existing VMs, capturing their disk state, OS, and installed applications. They are useful for replicating tailored environments across multiple VMs, ensuring consistency. To create a custom image, you first prepare a VM, generalize it with sysprep (Windows) or waagent (Linux), and then capture the image using Azure tools. Custom images streamline deploying multiple VMs with identical configurations.

Shared Image Gallery

The Shared Image Gallery (SIG) allows organizations to manage, version, and distribute custom images across multiple regions and subscriptions. It provides version control, replication, and access controls, making it ideal for enterprise-scale deployments and compliance requirements. With SIG, you can update images centrally and roll out updates seamlessly across your environment.

Managed Disks — Standard HDD, Standard SSD, Premium SSD & Ultra

Azure Managed Disks are the storage backbone of Azure virtual machines. They simplify disk management and provide different performance tiers suited to workload demands.

Standard HDD

Cost-effective, suitable for dev/test environments and infrequently accessed data. Offers the lowest performance, with higher latency, making it ideal for backup or archival workloads.

Standard SSD

Offers better performance and reliability compared to HDDs, suitable for production workloads that require moderate I/O performance, such as web servers and small databases.

Premium SSD

High-performance, low-latency disks designed for I/O-intensive applications like large databases, transactional systems, and real-time analytics. Provides consistent performance and durability.

Ultra Disks

Designed for the most demanding workloads, Ultra Disks offer configurable IOPS and throughput, suitable for large-scale SAP HANA, SQL Server, and data warehousing solutions. They provide the highest level of performance and are billed based on provisioned capacity.

Comparison table of Managed Disk types:

Disk Type Performance Use Cases Cost
Standard HDD Low Backup, Dev/Test Lowest
Standard SSD Moderate Web Servers, Small Apps Moderate
Premium SSD High Databases, Transaction Apps Higher
Ultra Disks Maximum Large-Scale Data Analytics Highest

VM Networking — NICs, Public IPs & Network Security Groups

Networking configuration is vital for Azure virtual machines. It ensures proper connectivity, security, and access control within your cloud environment.

Network Interface Cards (NICs)

Each VM requires one or more NICs that connect it to virtual networks (VNets). NICs can have multiple IP configurations, enabling multi-IP setups, load balancing, and traffic segregation.

Public IP Addresses

Associating a public IP with a VM enables inbound internet access. Azure supports static and dynamic public IPs. Static IPs are essential for DNS configurations, while dynamic IPs are suitable for transient workloads.

Network Security Groups (NSGs)

NSGs act as virtual firewalls, controlling inbound and outbound traffic based on rules. They are associated with NICs or subnets, providing granular security controls. Typical rules specify source/destination IPs, ports, and protocols.

Example NSG rule allowing SSH access:

az network nsg rule create --resource-group MyResourceGroup --nsg-name MyNSG --name AllowSSH --protocol Tcp --direction Inbound --priority 1000 --source-address-prefix * --source-port-range * --destination-address-prefix * --destination-port-range 22 --access Allow

Proper network configuration ensures secure, reliable, and efficient VM operation, which is critical in enterprise environments.

VM Availability — Availability Sets, Zones & SLA Guarantees

Ensuring high availability for Azure virtual machines involves strategic deployment across availability options provided by Azure, such as Availability Sets and Availability Zones.

Availability Sets

Availability sets distribute VMs across multiple fault domains (physical hardware) and update domains (maintenance groups). This setup minimizes downtime during hardware failures or maintenance activities. When deploying multiple VMs for a workload, placing them in the same availability set ensures resilience.

Availability Zones

Azure's Availability Zones are physically separate data centers within a region. Deploying VMs across different zones provides higher fault tolerance and disaster recovery capabilities. For mission-critical applications, zone-aware deployment is recommended.

SLA Guarantees

Azure guarantees a Service Level Agreement (SLA) of 99.95% uptime when VMs are deployed across multiple availability zones. Single-zone deployments typically offer a lower SLA, so planning for high availability involves architecture considerations aligned with business needs.

Example: Deploying a VM scale set across zones ensures continuous availability even if one zone experiences disruption, aligning with best practices for enterprise resilience.

Cost Optimization — Spot VMs, Reserved Instances & Auto-Shutdown

Managing costs effectively is key to leveraging Azure virtual machines. Several strategies help optimize expenditure without compromising performance or availability.

Spot VMs

Azure Spot VMs utilize unused capacity at significantly reduced prices, suitable for interruptible workloads like batch processing, testing, or stateless applications. They can be deallocated with minimal notice, so they are not ideal for critical systems.

Reserved Instances

Reserved Virtual Machine Instances involve committing to a 1- or 3-year term, offering discounts up to 72% compared to pay-as-you-go prices. They are ideal for predictable workloads and long-term projects, providing cost predictability and savings.

Auto-Shutdown

Configuring auto-shutdown schedules prevents unnecessary running VMs during off-hours, reducing costs. This can be set up via the Azure Portal or CLI, enabling automation for development, testing, or lab environments.

Example CLI command to enable auto-shutdown:

az vm auto-shutdown --resource-group MyResourceGroup --name MyVM --time 2200 --email admin@domain.com

Combining these strategies—using Spot VMs for non-critical tasks, reserved instances for steady workloads, and auto-shutdown policies—can significantly reduce your Azure expenditure while maintaining performance.

Key Takeaways

  • Azure virtual machines are versatile IaaS compute resources suitable for a wide range of workloads.
  • Choosing the correct VM series and size is crucial for balancing performance and cost.
  • Deployment methods include Azure Portal, CLI, and ARM templates, catering to different user needs.
  • VM images from Marketplace, custom images, and Shared Image Gallery streamline environment setup and replication.
  • Managed disks come in various performance tiers, enabling tailored storage solutions.
  • Networking components like NICs, public IPs, and NSGs ensure secure and reliable connectivity.
  • High availability is achieved through availability sets and zones, with SLAs supporting business continuity.
  • Cost optimization strategies such as Spot VMs, Reserved Instances, and auto-shutdown help manage cloud expenditure effectively.

Frequently Asked Questions

How do I choose the right size for my Azure virtual machine?

Choosing the right VM size depends on workload requirements, performance needs, and budget. Analyze CPU, memory, I/O, and GPU demands of your applications. Use Azure's VM size options and performance benchmarks to compare. For example, a web server might suffice with a Standard_D2s_v3, while large databases require Premium SSDs and larger VM sizes like E-series. Testing different sizes in a staging environment helps determine optimal fit. Azure's Cost Management tools can also assist in evaluating expenses. For comprehensive guidance, consider enrolling at Networkers Home.

What are the differences between Azure VM images and custom images?

Azure VM images are pre-configured templates available from the Azure Marketplace, including various OS versions and software stacks. They allow quick deployment of standard environments. Custom images, on the other hand, are derived from existing VMs that have been configured and generalized; they enable replication of tailored environments across multiple VMs, ensuring consistency. Custom images are useful when specific software configurations or customizations are needed, whereas marketplace images are ideal for standard setups. Using Shared Image Gallery enhances management and version control of custom images for large-scale deployments.

How can I ensure high availability for my Azure virtual machines?

High availability is achieved by deploying VMs across multiple fault and update domains using Availability Sets, which protect against hardware failures and maintenance. For even higher resilience, deploying VMs across multiple Availability Zones—physically separate data centers within a region—is recommended. This setup minimizes downtime during zone-specific failures. Additionally, using VM Scale Sets with zone-awareness ensures seamless scaling and fault tolerance. Properly architected deployments with these strategies can provide SLA guarantees of up to 99.99%, critical for enterprise applications and mission-critical workloads. For detailed training, visit Networkers Home.

Ready to Master Azure Cloud Fundamentals?

Join 45,000+ students at Networkers Home. CCIE-certified trainers, 24x7 real lab access, and 100% placement support.

Explore Course