Cloud service · Azure · Updated

Virtual Machines - Azure Virtual Machines provides on-demand Windows and Linux servers with configurable compute, storage, networking, and operating-system control.

In short

Azure Virtual Machines is an infrastructure-as-a-service offering for workloads that require control over the guest operating system and installed software. Azure manages the underlying physical infrastructure, while engineers configure and maintain the operating system, applications, network access, availability, and data protection.

Cloud Services Hub →

9 key features of Virtual Machines

01
Workload-specific VM sizes

Select general-purpose, compute-optimized, memory-optimized, storage-optimized, or GPU-enabled sizes according to workload requirements. Check regional availability, vCPU quotas, processor architecture, and per-VM disk and network limits before provisioning.

02
Windows, Linux, and custom images

Deploy supported operating-system images from Azure Marketplace or use your own prepared images. Azure Compute Gallery supports versioned image distribution so teams can deploy consistent operating-system and application baselines.

03
Persistent managed storage

Attach managed OS and data disks with performance characteristics suited to the application. Size disks and VMs together because either can impose an IOPS or throughput bottleneck, and keep durable data off temporary local storage.

04
Private networking and traffic control

Place VM network interfaces in virtual network subnets and control access with network security groups, routes, and network appliances. Supported sizes can use Accelerated Networking to reduce networking overhead.

05
Availability placement options

Deploy redundant VMs across availability zones or use availability sets where appropriate. These placement mechanisms reduce shared failure exposure but require application replication and traffic failover to maintain service availability.

06
Boot and workload security

Trusted Launch combines Secure Boot, vTPM, and boot integrity monitoring for supported configurations. Confidential VM families provide hardware-backed protection for data in use when their operating-system and workload requirements are met.

07
Managed identities

Assign a system-assigned or user-assigned managed identity to a VM so applications can request tokens for supported Azure services. Grant the identity narrowly scoped permissions instead of storing service credentials in configuration files.

08
Deployment and guest automation

Provision VMs through Azure Resource Manager templates, Bicep, Terraform, Azure CLI, or PowerShell. Use cloud-init on supported Linux images or VM extensions for initial configuration, and manage ongoing patching and configuration separately.

09
Fleet orchestration

Use Virtual Machine Scale Sets when multiple instances require coordinated provisioning, scaling, and lifecycle management. Configure autoscale rules and health monitoring explicitly rather than assuming individual VMs scale automatically.

Where Virtual Machines is used

  1. 01
    Migrate existing server applications

    Run applications that depend on a full operating system, custom middleware, or privileged installation steps without redesigning them for a managed runtime. Assess operating-system support, licensing, storage performance, and network dependencies before migration.

  2. 02
    Development and testing

    Create reproducible environments with specific operating systems, SDKs, and application versions. Use standardized images and scheduled deallocation to reduce configuration drift and unnecessary compute charges.

  3. 03
    Self-managed databases and enterprise software

    Host databases or packaged applications that require direct control over patching, configuration, and storage layout. Choose certified VM configurations where required and implement application-aware backup and high availability.

  4. 04
    Batch processing and GPU workloads

    Run rendering, simulation, data processing, or machine-learning jobs on suitable CPU or GPU families. Use checkpointing and durable output storage when placing interruption-tolerant jobs on Spot VMs.

  5. 05
    Hybrid infrastructure services

    Extend existing environments with application servers, domain services, or integration components in an Azure virtual network. Connect through VPN Gateway or ExpressRoute and design DNS, routing, identity, and failure handling across both environments.

  6. 06
    Sensitive workloads requiring isolation

    Use supported confidential VM configurations when applications require hardware-backed isolation of memory from the host environment. Validate image support, attestation requirements, and dependencies before selecting a confidential VM family.

How Virtual Machines is priced

Pay-as-you-go

Pay for allocated VM compute without a long-term commitment, with rates varying by size, region, operating system, and commercial offer. A stopped but allocated VM remains subject to compute charges; deallocation stops on-demand VM compute charges but does not remove charges for retained resources.

Azure Reserved VM Instances

Commit to eligible VM usage for a one-year or three-year term to receive a billing discount. Reservation matching depends on scope, region, and instance attributes or applicable size flexibility; a reservation discount does not itself guarantee deployment capacity.

Azure savings plan for compute

Commit to an hourly spend on eligible compute for a one-year or three-year term. The benefit applies to qualifying usage under the plan's scope, while usage beyond the commitment is charged at applicable rates.

Azure Spot Virtual Machines

Use spare Azure capacity at variable discounted prices for workloads that can tolerate eviction. Capacity and continued runtime are not guaranteed, so applications should checkpoint progress, externalize state, and support retries.

Azure Hybrid Benefit

Apply qualifying Windows Server or supported Linux subscription entitlements to eligible VM deployments under the relevant licensing terms. This is a licensing benefit rather than a separate compute capacity model, and eligibility must be verified before enabling it.

Storage, networking, and supporting services

Budget separately for managed disks, applicable disk operations and performance settings, public IP addresses, outbound data transfer, and services such as backup and monitoring. Marketplace software can add licensing charges, and retained resources can continue billing after VM deallocation or deletion.

Services Virtual Machines works with

A common production architecture places redundant application VMs in private virtual network subnets and distributes traffic through Azure Load Balancer. Network security groups restrict communication between tiers, while administrative access uses a controlled path rather than public SSH or RDP exposure. Applications use VM managed identities to retrieve secrets from Azure Key Vault, with narrowly scoped authorization and appropriate network connectivity.

Operational integrations separate visibility, security, backup, and disaster recovery. Azure Monitor collects platform metrics and selected guest telemetry for alerting and troubleshooting. Microsoft Defender for Cloud assesses security posture and provides additional protections when the relevant plans and prerequisites are configured. Azure Backup provides retained recovery points, while Azure Site Recovery supports regional replication and orchestrated failover for supported workloads.

Deploy these integrations through infrastructure as code alongside the VMs so network rules, identity assignments, monitoring configuration, and protection policies remain consistent. Test restores and failovers independently, including DNS changes, application startup order, and access to dependencies. Include telemetry ingestion, backup storage, replication, and network transfer in the architecture's cost model.

Azure Virtual Network

VM network interfaces attach to subnets in an Azure Virtual Network, where network security groups and routing govern connectivity. For example, place application VMs in a private subnet and permit database traffic only from the application tier. Use peering or hybrid connectivity when the application spans networks.

Azure Load Balancer

Azure Load Balancer distributes TCP or UDP traffic across VM backends and uses health probes to identify available endpoints. For example, place two application VMs in different availability zones behind a Standard Load Balancer. Configure probes to reflect application readiness and verify that network security rules permit both probes and client traffic.

Azure Monitor

Azure Monitor collects platform metrics, while Azure Monitor Agent and data collection rules collect selected guest logs and performance data. For example, send Linux syslog and memory counters to a Log Analytics workspace and alert on sustained memory pressure. Size retention and collection scope carefully to control ingestion costs.

Azure Backup

Azure Backup protects supported VM configurations through backup policies associated with a Recovery Services vault. For example, configure scheduled backups for a business application and regularly restore a recovery point into an isolated network. Cross-subscription backup supports placing the vault in a different subscription within the same tenant, subject to the feature's configuration requirements.

Azure Site Recovery

Azure Site Recovery replicates supported Azure VMs to another region and orchestrates recovery operations. For example, build a recovery plan that starts database servers before application servers and run test failovers in an isolated virtual network. Validate replication compatibility, target-region capacity, networking, and application consistency rather than treating replication as a replacement for backup.

Azure Key Vault

Applications running on VMs can use managed identities to retrieve authorized secrets, keys, or certificates from Azure Key Vault. For example, grant a VM identity access to a specific application secret instead of storing that secret in an image or deployment script. Configure Key Vault network access and authorization independently, and implement retry and caching behavior appropriate to the application.

Microsoft Defender for Cloud

Microsoft Defender for Cloud assesses VM security posture and offers additional server protection through applicable Defender for Servers plans. For example, use its recommendations to identify exposed management ports or missing security controls and route security alerts into incident response workflows. Enable the required plans, agents, and permissions explicitly because assessment and protection capabilities have different prerequisites.

Automation

Azure VMs can run Automation jobs locally through the Hybrid Runbook Worker extension. Runbooks can also manage VM lifecycle operations, such as deallocating tagged development VMs at the end of the workday.

Azure Adaptive Virtual Patching

Eligible Azure VMs can be enrolled in a protection shield. The service installs the Neuron extension to inventory the guest and apply supported vulnerability mitigations.

Azure Advisor

Azure VMs receive recommendations based on their configuration and utilization. Advisor can flag an underused VM for resizing or identify a VM that could benefit from availability or disaster recovery improvements.

Alternatives to Virtual Machines in other clouds

AWS

Amazon EC2Amazon EC2

Amazon EC2 and Azure Virtual Machines both run configurable cloud servers and offer on-demand, reserved, and Spot pricing. EC2 stops on-demand compute billing when an instance enters the stopped state, whereas Azure requires deallocation; EC2 describes reservations as commitments to a specific instance type, while Azure allows size flexibility where applicable.

Compare fact by fact
Virtual MachinesAmazon EC2
When compute billing stopsVM deallocated, not merely stoppedInstance stopped
Reservation size matchingSize flexibility where applicableSpecific instance type
Compared Nov 2026
Amazon LightsailAmazon Lightsail

Amazon Lightsail and Azure Virtual Machines both run Windows and Linux servers for applications and dev/test environments. Lightsail bundles compute, storage, and a transfer allowance in fixed monthly plans and offers one-click application templates; Azure bills on-demand compute separately from disks and outbound transfer and supports Marketplace and custom images.

Compare fact by fact
Virtual MachinesAmazon Lightsail
Server billingCompute, disk, and transfer separateFixed monthly bundles
Deployment templatesMarketplace and custom imagesOne-click app and stack templates
Network access controlsVNet security groups and routesPer-instance firewall

What is Virtual Machines

2 min read

Azure Virtual Machines provides virtualized servers for running Windows and Linux applications in Azure. Each VM has a selected size that determines its vCPU count, memory, and limits for storage and networking. Choose a VM when software requires administrative access, specific operating-system settings, custom agents, or installation procedures that are unsuitable for a managed application platform. Azure operates the physical hosts, but guest configuration, application maintenance, and recovery planning remain customer responsibilities.

Start by selecting a region, operating-system image, VM size, and availability configuration. General-purpose, compute-optimized, memory-optimized, storage-optimized, and GPU-enabled families support different workload profiles. Availability varies by region and zone, and deployment depends on both subscription quotas and available capacity. Validate processor architecture, image compatibility, disk support, and software licensing before deployment. Resizing can require a restart or deallocation, so plan changes around application availability requirements.

A VM normally uses an operating-system disk and can attach persistent data disks through Azure Managed Disks. Disk performance is constrained by both the selected disk configuration and the VM's aggregate I/O limits. Place databases and other durable application data on appropriately configured persistent disks. Temporary local storage, where provided, is not durable and must not contain the only copy of important data. Ephemeral OS disks are another distinct option for supported configurations and are appropriate when the operating system can be recreated rather than preserved.

VM network interfaces connect to subnets in an Azure Virtual Network. Apply network security groups and routing rules to control traffic, and avoid exposing SSH or RDP directly to the internet. Use private connectivity and controlled administrative access where possible. Configure an explicit outbound connectivity method for workloads that need internet access. Managed identities let applications authenticate to supported Azure services without embedding credentials, while Azure role-based access control governs management-plane permissions separately from guest operating-system access.

A single VM does not provide application-level high availability. Distribute redundant instances across availability zones where supported, or use availability sets to reduce exposure to shared infrastructure failures. Add health-based traffic distribution and ensure that application state is replicated or stored externally. Virtual Machine Scale Sets provide orchestration for fleets that need consistent configuration and scaling. Backups and regional disaster recovery address different failure scenarios and should be designed and tested separately.

Deploy repeatable configurations with infrastructure as code and standardized images. Collect guest telemetry with Azure Monitor Agent, configure alerts, patch supported operating systems through Azure Update Manager, and apply security controls such as Trusted Launch where compatible. Track compute, disk, network, licensing, and supporting-service charges together. Shutting down the guest operating system alone can leave the VM allocated and billable; deallocate it to stop on-demand VM compute charges, while recognizing that retained disks and other resources can continue to incur costs.

Azure architecture icons are the property of Microsoft. BlowStack is not affiliated with or endorsed by Microsoft.

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.