Study guide
5.2 Create, Configure, and Manage Virtual Machines
AZ-104 Microsoft Azure Administrator Study Guide Exam
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Exam Orientation and Microsoft Learn Source Control
1.1 Current AZ-104 Exam Facts 1.2 Administrator Role and Candidate Profile 1.3 Skills Outline and Weighted Study Map 1.4 Exam Duration, Question Types, Labs, and Learn Access 1.5 Scoring, Retakes, Renewal, and Account Choice 1.6 Using the Practice Bank, Labs, and Error Log
2 Chapter 2: Identity, RBAC, and Governance Foundations
2.1 Microsoft Entra Users, Groups, and Properties 2.2 Licenses, External Users, and SSPR 2.3 Azure RBAC Built-In Roles and Scopes 2.4 Role Assignment Interpretation and Deny Effects 2.5 Management Groups, Subscriptions, and Resource Groups 2.6 Azure Policy, Locks, Tags, and Governance Controls 2.7 Identity and Governance Case Lab
3 Chapter 3: Subscriptions, Policy, Costs, and Resource Organization
3.1 Subscription Design and Management Groups 3.2 Resource Groups, Lifecycle, and Move Operations 3.3 Tagging Strategy and Cost Allocation 3.4 Budgets, Alerts, and Azure Advisor Cost Recommendations 3.5 Policy, Initiative, Assignment, and Remediation 3.6 Resource Locks, RBAC, Policy, and Tags Combined 3.7 Governance and Cost Case Lab
4 Chapter 4: Storage Accounts, Access, and Data Protection
4.1 Storage Account Design, Redundancy, and Encryption 4.2 Storage Firewalls, Private Access, and Network Rules 4.3 SAS Tokens, Stored Access Policies, and Access Keys 4.4 Identity-Based Access for Azure Files 4.5 Blob Tiers, Lifecycle, Soft Delete, and Versioning 4.6 Azure Files, Snapshots, File Sync, and AzCopy 4.7 Storage Case Lab
5 Chapter 5: Compute, Virtual Machines, Scale Sets, and Bicep
5.1 ARM Templates, Bicep, and Deployment Workflow 5.2 Create, Configure, and Manage Virtual Machines 5.3 VM Disks, Sizes, Encryption, and Host Settings 5.4 Availability Zones, Sets, and VM Scale Sets 5.5 Move VMs Across Resource Groups, Subscriptions, and Regions 5.6 Backup, Restore, and Operational Maintenance for VMs 5.7 VM Compute Case Lab
6 Chapter 6: Containers, App Service, and Platform Compute
6.1 Azure Container Registry and Image Workflow 6.2 Azure Container Instances and Container Apps 6.3 Container Sizing, Scaling, and Environment Choices 6.4 App Service Plan, Apps, and Runtime Configuration 6.5 App Service Certificates, TLS, Custom Domains, and Networking 6.6 App Service Backups, Deployment Slots, and Scaling 6.7 Platform Compute Case Lab
7 Chapter 7: Virtual Networking, Routing, and Secure Access
7.1 VNet, Subnet, and Address Space Design 7.2 VNet Peering and Cross-Network Connectivity 7.3 Public IP Addresses and NAT Patterns 7.4 User-Defined Routes and Effective Routes 7.5 NSGs, ASGs, and Effective Security Rules 7.6 Azure Bastion, Service Endpoints, and Private Endpoints 7.7 Secure Networking Case Lab
8 Chapter 8: Name Resolution, Load Balancing, and Connectivity Troubleshooting
8.1 Azure DNS, Private DNS, and Name Resolution 8.2 Public and Internal Load Balancer Design 8.3 Backend Pools, Health Probes, and Load Balancing Rules 8.4 Load Balancing Troubleshooting Workflow 8.5 Network Watcher: IP Flow, Next Hop, and Connection Troubleshoot 8.6 Hybrid Connectivity, VPN, ExpressRoute, and DNS Considerations 8.7 Connectivity Troubleshooting Case Lab
9 Chapter 9: Monitoring, Alerting, Backup, and Site Recovery
9.1 Azure Monitor Metrics, Logs, and Diagnostic Settings 9.2 Log Analytics, KQL, and Operational Queries 9.3 Alert Rules, Action Groups, and Alert Processing Rules 9.4 VM, Storage, and Network Insights 9.5 Recovery Services Vault, Backup Vault, and Backup Policies 9.6 Azure Site Recovery, Failover, and Replication 9.7 Monitoring and Recovery Case Lab
10 Chapter 10: AZ-104 Integration and Troubleshooting Case Labs
10.1 Domain Weight Triage and Study Prioritization 10.2 Identity, Storage, and Compute Integrated Cases 10.3 Networking, Monitoring, and Security Integrated Cases 10.4 Migration, Move, Backup, and Recovery Cases 10.5 Permissions, Network, and Storage Troubleshooting Chain 10.6 Microsoft Learn Lookup Strategy Under Time Pressure 10.7 Full-Domain Case Lab
11 Chapter 11: Final Review, Exam Experience, Renewal, and Career Path
11.1 Final Two-Week Study Plan 11.2 Hands-On Lab Checklist and Command Review 11.3 Exam Day, Pearson VUE, Breaks, and Learn Access 11.4 Retake Plan, Score Report, and Weak-Domain Repair 11.5 Renewal Assessment and Annual Certification Maintenance 11.6 After AZ-104: AZ-305, AZ-400, SC-500, and Job Paths
5.2 Create, Configure, and Manage Virtual Machines
Key Takeaways Explain This Topic AI
A VM depends on supporting resources such as a NIC, subnet, OS disk, optional data disks, security rules, and often a public IP, Bastion, or load balancer.
Creation choices such as image, size, authentication, region, zone, disk type, and networking are difficult to change later and should be selected from workload requirements.
Administrators manage VMs through portal, CLI, PowerShell, Bicep, extensions, run command, update management, and guest-level tools.
Troubleshooting VM creation requires separating Azure control plane failures from guest OS, networking, boot, and extension failures.
Last updated: May 2026
VM Resource Anatomy
An Azure virtual machine is the compute resource, but it is not useful by itself. A working VM usually has an OS disk, one or more network interfaces, an IP configuration on a subnet, network security controls, boot diagnostics, and optional data disks. It may also have a managed identity, diagnostic settings, VM extensions, backup protection, update configuration, and association with a load balancer or application gateway.
A common exam trap is treating the VM as one object. The NIC belongs to Microsoft.Network, the disk belongs to Microsoft.Compute, the public IP belongs to Microsoft.Network, and the VM ties them together. If a deployment fails, the failed resource may be the NIC, disk, VM extension, or public IP rather than the VM itself.
- Design choice Why it matters Typical administrator decision
- Region Latency, compliance, service availability, quota Keep VM near users and dependent resources
- Availability zone Datacenter isolation Use zones for higher availability where supported
- Image OS, generation, licensing Select marketplace image, shared image, or custom image
- Size CPU, memory, temp disk, IOPS, cost Match workload and resize when possible
- Authentication SSH key, password, Entra login, local admin Prefer SSH keys and controlled admin access
- Network access Public IP, Bastion, VPN, private access Avoid direct internet exposure where possible
- Management Extensions, Run Command, serial console Plan recovery and automation paths
- Portal Creation Workflow
In the portal, the normal path is Virtual machines > Create > Azure virtual machine. The Basics tab sets subscription, resource group, VM name, region, availability option, security type, image, size, admin account, inbound ports, and licensing. Disks selects OS disk type, encryption options, and data disks. Networking selects or creates the virtual network, subnet, public IP, NIC NSG, and load balancing options. Management covers monitoring, identity, auto-shutdown, backup, and patch settings. Advanced covers extensions, cloud-init, user data, host group, proximity placement group, and custom data.
Portal creation is good for learning dependencies and one-off deployments. For repeatable build standards, use Bicep, ARM templates, Azure CLI, PowerShell, or an image pipeline. Exam questions may show a portal setting and ask which tab contains it. They may also describe a production standard and expect infrastructure as code.
- CLI and Bicep Examples
- A quick Linux VM build can be done with Azure CLI: az group create --name rg-lab-vm --location eastus
- az vm create \
- -resource-group rg-lab-vm \
- -name vm-linux-01 \
- -image Ubuntu2204 \
- -size Standard_B2s \
- -admin-username azureadmin \
- -ssh-key-values ~/.ssh/id_rsa.pub \
- -vnet-name vnet-lab \
- -subnet snet-vms \
- -public-ip-sku Standard
- az vm open-port --resource-group rg-lab-vm --name vm-linux-01 --port 22
For production, opening SSH from the internet is often the wrong answer. Use Azure Bastion, VPN, just-in-time VM access from Microsoft Defender for Cloud, or a private jump path. If the exam asks for browser-based RDP or SSH without a public IP on the VM, choose Azure Bastion.
- A minimal Bicep VM pattern shows how resources connect: param location string = resourceGroup().location
- param vmName string = 'vm-app-01'
- param adminUsername string
- @secure()
- param adminPassword string
- resource nic 'Microsoft.Network/networkInterfaces@2024-05-01' existing = {
- name: '${vmName}-nic'
- }
- resource vm 'Microsoft.Compute/virtualMachines@2024-07-01' = {
- name: vmName
- location: location
- properties: {
- hardwareProfile: {
- vmSize: 'Standard_D2s_v5'
- }
- osProfile: {
- computerName: vmName
- adminUsername: adminUsername
- adminPassword: adminPassword
- }
- storageProfile: {
- imageReference: {
- publisher: 'MicrosoftWindowsServer'
- offer: 'WindowsServer'
- sku: '2022-datacenter-azure-edition'
- version: 'latest'
- }
- osDisk: {
- createOption: 'FromImage'
- managedDisk: {
- storageAccountType: 'Premium_LRS'
- }
- }
- }
- networkProfile: {
- networkInterfaces: [
- {
- id: nic.id
- }
- ]
- }
- }
- }
This example assumes an existing NIC. In a full deployment, the VNet, subnet, NSG, public IP if needed, NIC, VM, diagnostics, and extensions may all be in the same Bicep file or modules.
VM Management Tasks
Administrators commonly start, stop, restart, redeploy, reapply, resize, attach disks, update tags, add extensions, configure identity, reset passwords, and capture images. Stop from inside the OS does not necessarily deallocate the VM, so compute charges can continue. In Azure, use Stop or az vm deallocate when you want to release compute allocation and stop compute billing. Storage costs for disks remain.
- Useful commands: az vm get-instance-view -g rg-prod-compute -n vm-app-01
- az vm list-sizes --location eastus --output table
- az vm resize -g rg-prod-compute -n vm-app-01 --size Standard_D4s_v5
- az vm deallocate -g rg-prod-compute -n vm-app-01
- az vm start -g rg-prod-compute -n vm-app-01
- az vm run-command invoke \
- g rg-prod-compute \
- n vm-app-01 \
- -command-id RunPowerShellScript \
- -scripts "Get-Service W32Time"
Run Command is useful when network access is broken but the Azure VM agent is healthy. Serial Console is useful for boot and OS-level recovery, especially when firewall rules, boot loaders, or network configuration prevent normal access. Redeploy moves a VM to a new Azure host while preserving disks and configuration; it can help with host-level issues but causes downtime.
Extensions and Guest Configuration
VM extensions install agents, run scripts, join domains, configure monitoring, install antimalware, or apply custom setup. The Custom Script Extension is common, but it should be idempotent and log clearly. Extension failures are often guest problems: blocked downloads, bad script exit codes, missing permissions, DNS failure, TLS inspection, or incompatible OS.
Troubleshooting extension states:
- State Meaning Next action
- Provisioning succeeded Extension completed Verify application-level result
- Provisioning failed Handler returned failure Review extension status and guest logs
- Transitioning Still running or stuck Check script duration and agent health
- VM agent not ready Guest agent unavailable Check boot diagnostics, serial console, or agent install
- Scenario Walkthrough
A company needs a Windows Server VM for an internal accounting app. It must not expose RDP to the internet, must be recoverable, and must use a predictable deployment process. A good design is a Bicep deployment that creates or references the subnet, deploys a VM without a public IP, enables a managed identity if the app needs Azure resource access, installs the Azure Monitor Agent, enables boot diagnostics, and protects the VM with Azure Backup. Administrative access should be through Bastion or VPN.
If users cannot connect after deployment, check the VM power state, guest OS firewall, NSG effective rules, route table, DNS, Bastion or VPN path, and application listener. Do not start by rebuilding the VM. AZ-104 often rewards methodical isolation: control plane, VM state, network path, guest OS, then application.