Azure Virtual Machines: Sizes, Disks, and Zones (AZ-104)
An Azure virtual machine (VM) is an on-demand, resizable server you run in the cloud, and creating one means choosing an image, a size, sign-in credentials, a resource group and a region — plus a few settings, such as the availability option and the OS disk type, that cannot be changed afterwards. An Azure administrator's real work is everything around that first click: configuring the guest without signing in, picking the right size family and pricing, attaching and protecting managed disks, and placing VMs so a single hardware or datacenter fault does not take the workload down. This lesson covers every skill in the AZ-104 task: creating a VM (authentication, cloud-init and extensions, custom images, Spot pricing), configuring encryption at host and telling it apart from the other disk encryption options, moving a VM to another resource group, subscription or region, managing VM sizes and disks, deploying to availability zones and availability sets, and deploying and configuring Virtual Machine Scale Sets.
On this page11 sections
- Creating a virtual machine
- Signing in to Linux VMs: SSH keys, VMAccess and Entra ID
- Configuring the guest at creation and using custom images
- Azure Spot Virtual Machines
- Choosing a VM size
- Managing virtual machine disks
- Availability zones versus availability sets
- Scenario: placing a highly available web tier
- Virtual Machine Scale Sets: orchestration, upgrades and autoscale
- Encrypting VM disks: encryption at host and the alternatives
- Moving a virtual machine
- Create a VM and identify which creation-time choices (availability set, ephemeral OS disk) cannot be changed later
- Configure Linux sign-in with SSH keys and compare it with VMAccess and Microsoft Entra ID login
- Configure a guest at first boot with cloud-init or the Custom Script Extension, and deploy from a generalized image in Azure Compute Gallery
- Decide when Azure Spot VMs fit a workload and how eviction works
- Match VM size families (B, D, E, F, L) to workloads and resize a VM, including inside an availability set
- Choose a managed disk type, including Premium SSD v2 and Ultra Disk, and add, expand and cache disks correctly
- Compare availability zones and availability sets and their SLAs
- Configure scale set orchestration, upgrade policy, Spot Priority Mix and autoscale profiles
- Enable encryption at host and distinguish it from server-side encryption, double encryption and Azure Disk Encryption
- Move a VM to another resource group, subscription or region and handle the special cases
Creating a virtual machine
Creating an Azure virtual machine comes down to a handful of decisions that the portal, Azure CLI, Azure PowerShell and ARM/Bicep templates all ask for. Most can be changed later; a few cannot, so they are the ones to get right first.
- Image — the operating system and any pre-installed software, such as Windows Server 2022 or Ubuntu Server, either from the Marketplace or from your own custom image (covered below). The image is the starting point for the OS disk.
- Size — the combination of vCPUs and memory (and sometimes GPUs or fast local storage) that sets performance and price. Sizes are grouped into families, covered later.
- Authentication — a username plus password for Windows; an SSH public key (recommended) or a password for Linux.
- Resource group and region — the management container, and the location where the VM runs; pick a region close to users that offers the sizes and zones you need.
- Availability option — no redundancy, an availability zone, a virtual machine scale set, or an availability set.
- Security type — Standard, Trusted launch (Secure Boot and vTPM, the default for supported images) or Confidential VM.
- OS disk — its disk type, and whether it is a normal persistent managed disk or an ephemeral OS disk.
Behind the scenes, creating a VM also creates supporting resources: the OS disk, a network interface (NIC) that connects the VM to a subnet, and usually a public IP. The deeper virtual network and network security group configuration belongs to the networking domain.
What you can and cannot change later. The settings below are worth checking before you select Create.
| Setting | Change after creation? |
|---|---|
| Availability set membership | No — a VM joins a set only when it is created; to add or move it you delete the VM (keeping its disks) and recreate it |
| Ephemeral versus persistent OS disk | No — chosen at creation only |
| Availability zone | Not by a simple setting change — the VM is redeployed into the other zone |
| Size | Yes — a resize restarts the VM (see Choosing a VM size) |
| Data disk type, size and caching | Yes — add, expand, retype (deallocated) or change caching later |
| Resource group and subscription | Yes — with a Resource Manager move |
Signing in to Linux VMs: SSH keys, VMAccess and Entra ID
The recommended way to sign in to a Linux VM is SSH public key authentication, chosen when the VM is created. You give Azure only the public key; the private key never leaves the client, and when you choose SSH key authentication at creation, password sign-in is disabled, so the key pair is the only way in.
At creation the portal offers three sources for the key: generate a new key pair (Azure stores the public key and lets you download the private key once), use an existing key stored in Azure (an SSH key resource), or use an existing public key that you paste in — the right choice when a team already holds its own key pair.
| Method | What it does | Watch out for |
|---|---|---|
| SSH public key at creation | Installs your public key; password authentication disabled | Only the public key is ever supplied to Azure |
| VMAccess extension (Reset password) | Adds or resets an SSH public key or a password on an existing VM, and can repair the SSH configuration | Adding a key does not switch off password authentication that is already enabled |
| Microsoft Entra ID login (AADSSHLoginForLinux extension) | Users sign in with their Entra identity; Azure RBAC roles (Virtual Machine Administrator Login / User Login) control access | Uses short-lived certificates issued through Entra ID, not a user's own key pair |
For Windows VMs the equivalent creation-time choice is the local administrator username and password; Entra ID sign-in for Windows uses the AADLoginForWindows extension. Network paths to the VM (Azure Bastion, VPN) are covered in the networking domain.
Configuring the guest at creation and using custom images
You configure the inside of a VM at creation time, without signing in, by passing a first-boot configuration or a script extension; you create many identical VMs by deploying from a generalized custom image.
cloud-init (Linux). Most Linux Marketplace images run cloud-init on first boot. You supply a declarative cloud-config file (install packages, create users, write files, run commands) as the VM's custom data on the Advanced tab, with --custom-data in Azure CLI, or in a template. Windows stores custom data on the disk but does not execute it.
Custom Script Extension (Windows and Linux). The Custom Script Extension downloads scripts from URIs — for example a storage account or GitHub — and runs them inside the VM through the Azure VM agent. Because it is an ARM resource (Microsoft.Compute/virtualMachines/extensions), it is the standard way to run post-deployment configuration from a template, for any number of VMs, with nobody signing in.
Custom images. To build many VMs from a configured reference machine, first generalize it so each new VM gets its own identity: run Sysprep with the generalize option (and shut down) on Windows, or waagent -deprovision+user on Linux. A generalized source VM cannot be started and used again. Capture the image into an Azure Compute Gallery: a gallery holds image definitions, each with numbered image versions that you replicate to the regions where VMs will be deployed, and you share the gallery or definition with Azure RBAC. A gallery can also hold specialized images (not generalized), which keep the source machine's identity and are meant for cloning a single machine rather than mass deployment.
Azure Spot Virtual Machines
Azure Spot Virtual Machines run on spare Azure capacity at a deep discount, in exchange for no availability SLA and the risk of eviction. They suit interruptible work that can stop and resume — batch jobs that checkpoint, rendering, CI build agents, dev/test — and never a workload that must stay up.
- Eviction for capacity — Azure takes the VM back whenever it needs the capacity. This can always happen.
- Eviction for price — you can set a maximum price per hour; if the current Spot price rises above it, the VM is evicted. A max price of -1 means "pay up to the standard pay-as-you-go price" — the VM is then never evicted for price, but it can still be evicted for capacity.
- Eviction policy — Deallocate (the default: the VM stops, its disks remain and are still billed, and you can try to start it later) or Delete (the VM and its disks are removed).
Spot pricing is chosen on the Basics tab when you create the VM. Compare it with reservations and savings plans, which discount steady, always-on usage and keep the normal SLA. In a scale set, Spot and regular VMs can be mixed with Spot Priority Mix (see the scale set section).
Choosing a VM size
A VM's size sets its vCPUs, memory and other characteristics, and Azure groups sizes into families tuned for different workloads. Matching a workload profile to a family is a common exam task.
| Family | Type | Best for |
|---|---|---|
| B-series | Burstable, general purpose | Low average CPU with short spikes — the VM banks CPU credits while it runs below its baseline and spends them to run at full CPU during a burst. Dev/test, small web servers, light scheduled jobs |
| D-series | General purpose | Balanced CPU-to-memory — most production web and application servers |
| F-series | Compute optimized | High CPU-to-memory ratio — batch processing, CPU-heavy application servers |
| E-series | Memory optimized | High memory-to-CPU ratio — relational databases, in-memory caches, analytics |
| L-series | Storage optimized | High throughput and IOPS on large local NVMe disks — NoSQL databases, data warehousing |
Other families cover GPUs (N-series), very large memory (M-series) and high-performance computing (H-series). The pattern to remember: B and D balance CPU and memory, F gives more CPU per gigabyte, E gives more memory per vCPU, and L adds fast local storage. A B-series VM whose load stays high all the time runs out of credits and drops to its baseline — steady high CPU belongs on D or F.
Resizing is done from the VM's Size blade, Azure CLI (az vm resize) or PowerShell, and always restarts the VM. On a running VM, the Size list shows only the sizes available on the hardware cluster the VM currently runs on. If the size you need is offered in the region and you have quota but it is missing from the list, stop (deallocate) the VM: deallocation releases the cluster, and every size in the region then appears. A restart does not help, because a restarted VM stays on the same cluster.
Availability sets add a constraint. All VMs in an availability set share one cluster. If the target size is not available on that cluster, deallocating only the VM you are resizing is not enough — you must deallocate every VM in the set, resize, and start them again. Also check that the new size supports the disk types and the number of data disks already attached.
Managing virtual machine disks
Every VM has an OS disk that boots the machine, usually a temporary disk, and as many data disks as its size allows. Azure VM disks are managed disks: Azure handles the storage account, replication and availability, and you pick a type and a size.
| Disk type | Performance model | Best for | Constraints |
|---|---|---|---|
| Standard HDD | Lowest, variable latency | Backups, archival, infrequent access — lowest cost | OS or data disk |
| Standard SSD | Consistent, modest IOPS | Light production, web servers, dev/test | OS or data disk |
| Premium SSD | IOPS and throughput fixed by the disk size you pick | Most production databases and latency-sensitive apps | OS or data disk |
| Premium SSD v2 | Capacity, IOPS and throughput set independently; up to 80,000 IOPS per disk | Production databases that need sub-millisecond latency and tunable performance at lower cost than Ultra | Data disks only; no host caching |
| Ultra Disk | Capacity, IOPS and throughput set independently; up to 400,000 IOPS per disk | The most demanding, transaction-heavy databases (SAP HANA, top-tier SQL) | Data disks only; no host caching |
Choose the cheapest tier that meets the need: Standard HDD when cost beats speed, Premium SSD for most production work, Premium SSD v2 when you want to raise IOPS or throughput later without resizing the disk, and Ultra Disk only when a single disk must go beyond what Premium SSD v2 offers. Neither Premium SSD v2 nor Ultra Disk can be an OS disk.
Adding and growing data disks. You can attach a new or existing data disk to a running VM without a restart. The disk then appears to the guest as raw storage: you must initialize, partition and format it inside the OS (Disk Management on Windows; partition, mkfs and an /etc/fstab entry on Linux) before applications can use it. The maximum number of data disks is set by the VM size — to attach more, resize to a larger size. You can expand a disk to a larger size (then extend the partition inside the guest), but you can never shrink one. Changing a disk's type, for example Standard SSD to Premium SSD, requires the VM to be deallocated.
Host caching is available on Standard HDD, Standard SSD and Premium SSD disks (not on Premium SSD v2 or Ultra Disk) and tunes performance: ReadOnly suits read-heavy database data disks, None suits write-heavy log disks, and the OS disk defaults to ReadWrite.
The temporary disk (drive D: on many Windows sizes, /dev/sdb1 or /mnt on Linux) is storage local to the physical host, not a managed disk. Its contents survive a normal reboot but are lost when the VM is deallocated, redeployed, or resized onto different hardware, because the VM then lands on a new host. Use it for page files and scratch data only.
Ephemeral OS disks put the OS disk on that same local storage — the VM's cache disk, temp disk or NVMe disk placement — instead of in Azure Storage. They give lower OS-disk latency, faster reimage and no OS-disk storage cost, which suits stateless VMs and scale set instances rebuilt from an image. The trade-offs: anything written to the OS disk is lost on reimage or host change, the VM does not support stop-deallocate, and you can choose an ephemeral OS disk only when the VM is created.
Availability zones versus availability sets
A single VM depends on one host, so Azure offers two ways to spread VMs so a fault affects only part of a workload: availability zones across datacenters, and availability sets inside one datacenter. Telling them apart is one of the most tested comparisons in this domain.
Availability zones are physically separate datacenters within one Azure region, each with independent power, cooling and networking. Deploying two or more VMs across two or more zones survives the loss of a whole datacenter and qualifies for a 99.99% VM SLA. A single zonal VM is still in one datacenter: its LRS managed disks are created in the same zone, so the zone setting alone does not make it resilient. Put the VMs behind a load balancer whose frontend is zone-redundant (served from every zone) rather than zonal (tied to one zone), so the entry point also survives a zone failure.
Availability sets protect against smaller failures within a single datacenter. Azure spreads the set's VMs across fault domains (racks that share power and a network switch, so one rack failure hits only one domain) and update domains (groups that Azure reboots one at a time during planned platform maintenance). Two or more VMs in a set qualify for a 99.95% SLA. Membership is decided at creation: an existing VM cannot be added to a set without recreating it. A VM is either zonal or in an availability set — the two options are mutually exclusive. Availability sets remain the right choice in regions without zones.
| Aspect | Availability zones | Availability set | Single VM |
|---|---|---|---|
| Protects against | Whole datacenter failure | Rack failure and planned maintenance | Nothing beyond the host's own resilience |
| Spread across | Separate datacenters in a region | Fault and update domains in one datacenter | One host |
| VM connectivity SLA | 99.99% (2+ VMs across 2+ zones) | 99.95% (2+ VMs) | 99.9% when every OS and data disk is Premium SSD, Premium SSD v2 or Ultra Disk |
| When decided | At creation (moving zones means redeploying) | At creation only | — |
Read the requirement: survive a datacenter failure or the 99.99% SLA means zones; protection from rack failures and patching in one datacenter, or a region with no zones, means an availability set.
Scenario: placing a highly available web tier
Consider a concrete decision. Your team runs a customer-facing web application on two Azure VMs behind a load balancer, and the business wants the strongest single-region availability the platform can offer, with resilience to a complete datacenter outage. Which placement do you choose?
An availability set would protect the two VMs from a rack failure or a maintenance reboot, but every VM in the set lives in the same datacenter. If that datacenter lost power, both VMs — and your web tier — would go down, and the set only carries a 99.95% SLA.
The right answer is availability zones. Deploy VM 1 into zone 1 and VM 2 into zone 2 of the same region. The two zones are physically separate datacenters with independent power, cooling, and networking, so an outage in one zone leaves the other serving traffic. This configuration qualifies for the 99.99% VM SLA, the highest single-region guarantee, and directly meets the "survive a datacenter failure" requirement. Front the zonal VMs with a Standard load balancer whose frontend is zone-redundant, so the public entry point keeps answering and requests flow to whichever zone is healthy — a zonal frontend pinned to zone 1 would fail with that zone.
The lesson generalises: when a scenario stresses surviving a whole-datacenter failure or names the 99.99% SLA, choose availability zones; when it only needs protection from rack failures and patching within one datacenter, an availability set is enough. For a fleet that also needs to scale, the next section introduces scale sets.
Virtual Machine Scale Sets: orchestration, upgrades and autoscale
A Virtual Machine Scale Set (VMSS) runs a group of load-balanced VM instances from one model and can add or remove instances automatically. Use one when a stateless tier needs many identical VMs that grow and shrink with demand; a scale set can also spread instances across availability zones and fault domains.
Orchestration mode is chosen at creation:
| Aspect | Flexible | Uniform |
|---|---|---|
| Instances | Standard VMs you manage with normal VM APIs; can mix sizes and Spot with regular priority | Identical instances managed through scale-set VM APIs |
| Spot Priority Mix | Supported | Not supported |
| Typical use | Recommended for new workloads, including high availability at scale | Large fleets of identical, stateless instances (existing designs) |
Spot Priority Mix (Flexible only) keeps a ratio of regular and Spot VMs as the set scales: baseRegularPriorityCount is the number of instances that are always regular priority, and regularPriorityPercentageAboveBase is the share of regular VMs in all capacity above that base — the rest are Spot.
Upgrade policy decides how instances pick up a changed scale set model, such as a new image version:
- Manual — nothing changes until you update instances yourself.
- Automatic — instances are updated without waiting, in no guaranteed order, so they can be down at the same time.
- Rolling — instances are updated in batches, with optional pauses, and the upgrade stops if upgraded instances turn unhealthy. It needs a health signal: the Application Health extension on Flexible scale sets, and either that extension or a load balancer health probe on Uniform scale sets.
Autoscale (Azure Monitor autoscale) works through profiles. The default profile applies when nothing else does; a recurring profile applies on a weekly schedule (for example weekdays 08:00–18:00); a fixed-date profile applies for one date range, such as a sale event. Only one profile is active at a time, and each has its own minimum, maximum and default instance count and its own rules — rules are not inherited from the default profile. A scheduled profile with no rules never reacts to load and holds the instance count at its minimum. Each rule pairs a metric condition (such as average CPU above 70% over 10 minutes) with an action and a cool-down; always pair scale-out rules with scale-in rules so capacity also falls.
Encrypting VM disks: encryption at host and the alternatives
Azure managed disks are always encrypted at rest — by default through server-side encryption (SSE) in Azure Storage, or on the host itself when encryption at host is on; the other options add coverage or control on top. The exam tests which option covers which data and where the encryption runs.
| Option | Where it runs | What it covers | Notes |
|---|---|---|---|
| SSE with platform-managed keys | Azure Storage | OS and data disks at rest | Always on, nothing to configure |
| SSE with customer-managed keys | Azure Storage | OS and data disks at rest, under your key in Key Vault or Managed HSM | Configured through a disk encryption set |
| Double encryption at rest | Azure Storage | Two layers at rest: platform key plus your key, using different algorithms or modes | Disk encryption set type EncryptionAtRestWithPlatformAndCustomerKeys; not supported on Ultra Disk or Premium SSD v2 |
| Encryption at host | The physical host server | Temp disk, ephemeral OS disk, OS/data disk caches, and data flowing encrypted from host to storage | No guest CPU used; nothing installed in the VM |
| Azure Disk Encryption (ADE) | Inside the guest OS (BitLocker / dm-crypt) | OS and data volumes, secrets in Key Vault | Uses guest CPU; retires on 15 September 2028 |
| Confidential disk encryption | Confidential VMs | OS disk, with keys bound to the VM's virtual TPM | Only for the Confidential VM security type |
Encryption at host encrypts data on the Azure host the VM runs on, so the temp disk and caches — which are not managed disks and which SSE never sees — are encrypted, and disk data is already encrypted when it flows into Azure Storage (such disks are encrypted by the host rather than by Storage). One exception to know: VM sizes of version 5 and later (for example Dsv5 or Dsv6) encrypt their temp disk and any ephemeral OS disk at rest automatically; on older sizes the temp disk is unencrypted unless encryption at host is on. Microsoft recommends it, rather than ADE, for new VMs. Caches and the host-to-storage flow use the same key type as the disk's SSE (platform- or customer-managed); the temp disk and ephemeral OS disk always use platform-managed keys.
To enable it:
- Register the feature once per subscription:
az feature register --namespace Microsoft.Compute --name EncryptionAtHost(orRegister-AzProviderFeature), then wait for the state to read Registered. Until then, deployments that request it are rejected. - Choose a VM size that supports encryption at host.
- Set it on the VM (Disks tab,
--encryption-at-host true, orsecurityProfile.encryptionAtHostin a template). For an existing VM, deallocate it first, enable the setting, then start it.
A VM that has ever had Azure Disk Encryption enabled cannot use encryption at host — the two are not combined. Choose ADE only when a requirement explicitly needs encryption performed by the guest OS with BitLocker or dm-crypt, and plan for its 2028 retirement.
Moving a virtual machine
Moving a VM to another resource group or subscription is a native Azure Resource Manager move; moving it to another region uses Azure Resource Mover. Confusing the two is a classic exam trap.
Resource group or subscription
Select the VM with its dependent resources — disks, NIC, public IP — choose Move, and pick the destination; Azure validates the move first. The VM keeps running, its region does not change (even if the target resource group was created in another region — a resource group's location only stores its metadata), and every moved resource gets a new resource ID, so update scripts, templates and role assignments that reference the old IDs. A subscription move must stay within the same Microsoft Entra tenant.
Special cases:
- Azure Disk Encryption — a VM using ADE with Key Vault can move between resource groups (deallocate it first), but to move it to another subscription you must disable the encryption before the move.
- Azure Backup — delete the VM's restore point collection (the instant-recovery snapshots in the backup resource group) before the move. Recovery points in the Recovery Services vault are kept. If soft delete is on, deleted restore points are retained for 14 days and block the move until they are purged.
- Availability sets — a VM in an availability set cannot be moved on its own; move the availability set together with all of its VMs.
- Customer-managed keys — managed disks encrypted through a disk encryption set with customer-managed keys cannot be moved to another subscription.
Another region with Azure Resource Mover
A region move copies the VM's data to the target region, so you use Azure Resource Mover, which orchestrates the steps in a move collection for one source and one target region:
- Add resources and resolve dependencies — Resource Mover validates the selection and adds missing dependents (disks, NIC, virtual network, NSG, resource group).
- Prepare — for a VM, replication to the target region starts.
- Initiate move — the source VM is shut down and the replica VM is created in the target region, where you test it.
- Commit move to finish, or Discard move to abandon the attempt: discard removes the replica, keeps the source as the copy of record, and returns the resource to Initiate move pending, so you can retry without preparing again.
- Delete source resources once the move is committed.
Azure Site Recovery was historically used for region moves; Resource Mover is the purpose-built, recommended tool.
Tip. Expect scenario questions built on stated constraints. "Survive a datacenter failure" or "99.99%" points to availability zones; "fault and update domains" or a region without zones points to an availability set, which a VM joins only at creation. Know which choices are fixed at creation (availability set, ephemeral OS disk), how SSH key authentication differs from VMAccess and Entra ID login, and when cloud-init, the Custom Script Extension or an Azure Compute Gallery image fits. Be ready to pick a size family from a workload profile (B burstable, E memory, F compute, L storage), to resize when a size is missing (deallocate; all VMs in an availability set), and to choose between Premium SSD, Premium SSD v2 and Ultra Disk from IOPS and tuning needs. Encryption questions separate encryption at host (temp disk, caches, no guest agent; register the feature, deallocate, never after ADE) from SSE with customer keys, double encryption and Azure Disk Encryption. Scale set questions cover Flexible versus Uniform, Spot Priority Mix, rolling upgrades with a health signal and autoscale profiles that each need their own rules. Move questions test that resource IDs change but the region does not, the ADE and Backup prerequisites, and the Resource Mover states.
- Availability set membership and an ephemeral OS disk are fixed when a VM is created; size, data disk type and caching can change later.
- SSH public key authentication at creation supplies only the public key and disables password sign-in; VMAccess can add a key without disabling passwords, and Entra ID login uses Entra-issued certificates.
- cloud-init in custom data configures Linux at first boot; the Custom Script Extension runs scripts on Windows or Linux from a template; Windows does not execute custom data.
- Generalize with Sysprep or waagent before capture, and keep versioned, region-replicated, RBAC-shared images in Azure Compute Gallery.
- Spot VMs are deeply discounted, have no SLA and can always be evicted for capacity; max price -1 only removes price eviction.
- B is burstable on CPU credits, D general purpose, E memory optimized, F compute optimized, L storage optimized; a missing size on a running VM appears after deallocation (all VMs, in an availability set).
- Premium SSD v2 (up to 80,000 IOPS) and Ultra Disk (up to 400,000) tune IOPS independently and are data disks only; new data disks must be initialized and formatted in the guest.
- The temp disk survives a reboot but not deallocation, redeploy or a move to new hardware.
- Zones give 99.99% across datacenters, availability sets 99.95% inside one, a single premium-disk VM 99.9%; zones and sets are mutually exclusive.
- Scale sets: Flexible orchestration supports Spot Priority Mix; rolling upgrades need a health signal; each autoscale profile needs its own rules.
- Encryption at host covers temp disk, caches and the host-to-storage flow without guest CPU; register EncryptionAtHost, deallocate existing VMs, and never after ADE, which retires in September 2028.
- Resource group and subscription moves keep the region but change resource IDs; region moves use Azure Resource Mover (prepare, initiate, commit or discard, delete source).
Frequently asked questions
What is the difference between an availability set and an availability zone?
An availability set spreads VMs across fault domains (racks with shared power and network) and update domains (maintenance reboot groups) inside a single datacenter, giving a 99.95% SLA for two or more VMs. An availability zone is a physically separate datacenter within a region; two or more VMs across two or more zones survive a whole-datacenter outage and get a 99.99% SLA. A VM joins a set only at creation, and a VM cannot be both zonal and in an availability set. Use zones where the region offers them and you must survive a datacenter failure.
Which managed disk type should I choose for an Azure VM?
Match the disk to the workload. Standard HDD is cheapest, for backups and rarely accessed data. Standard SSD suits light production and web servers. Premium SSD is the default for production databases, with performance set by disk size. Premium SSD v2 lets you set capacity, IOPS (up to 80,000) and throughput independently, and Ultra Disk does the same up to 400,000 IOPS for the most demanding databases. Premium SSD v2 and Ultra Disk are data disks only and do not support host caching.
Why is a VM size missing from the resize list in the Azure portal?
On a running VM, the Size list shows only sizes available on the hardware cluster the VM currently runs on. Stop (deallocate) the VM and the full list for the region appears; a restart does not help because the VM stays on the same cluster. If the VM is in an availability set and the size is still missing, deallocate every VM in the set, resize, then start them again. Every resize restarts the VM.
Is data on the Azure temporary disk kept after a restart?
Data on the temporary disk survives a normal reboot, but it is lost when the VM is stopped (deallocated), redeployed, or resized onto different hardware, because the temporary disk is storage local to the physical host and the VM lands on a new host. Keep only page files and scratch data on it, and store anything you need on the OS disk or a managed data disk.
What does encryption at host protect, and how do I enable it?
Encryption at host encrypts data on the physical Azure host: the temporary disk, ephemeral OS disks, the OS and data disk caches, and data flowing from the host to Azure Storage, without using guest CPU. Register the Microsoft.Compute EncryptionAtHost feature on the subscription, choose a supported VM size, and set the option on the VM; an existing VM must be deallocated first. A VM that has ever used Azure Disk Encryption cannot use it, and the temp disk always uses platform-managed keys. VM sizes of version 5 and later (such as Dsv5) encrypt the temp disk at rest even without it.
Should I still use Azure Disk Encryption on new VMs?
Microsoft recommends encryption at host for new VMs instead of Azure Disk Encryption (ADE), which encrypts volumes inside the guest with BitLocker or dm-crypt and retires on 15 September 2028. Use ADE only when a requirement explicitly demands in-guest encryption, and plan the migration. For customer control of keys at rest, use server-side encryption with customer-managed keys through a disk encryption set, or double encryption at rest for two layers.
How do you move an Azure VM to another resource group, subscription, or region?
A resource group or subscription move is a native Resource Manager Move of the VM with its disks, NIC and public IP: the region stays the same, the VM keeps running, and resource IDs change. Disable Azure Disk Encryption before a subscription move and delete the Azure Backup restore point collection first. A region move uses Azure Resource Mover: add resources and dependencies, prepare, initiate move, then commit (or discard to retry), and finally delete the source.
When should I use Spot VMs or a scale set with Spot Priority Mix?
Use Azure Spot VMs for interruptible work that can checkpoint and restart, such as batch rendering or CI agents: they are deeply discounted but have no SLA and can be evicted whenever Azure needs the capacity, even with a max price of -1. When a scale set needs a guaranteed base of regular VMs plus cheaper Spot capacity on top, use Flexible orchestration with Spot Priority Mix, which keeps the regular-to-Spot ratio as the set scales.
Source
This lesson covers the "Deploy and manage Azure compute resources" domain of the official AZ-104 exam guide. Vendors revise their guides — check the source for the current version.
- Microsoft AZ-104 study guide — Microsoft Learn
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.