AZ-104
Deep Dive
Strategies and tools for optimizing the performance, monitoring, and cost of virtual machines in Azure. The AZ-104 tests performance diagnostics, Accelerated Networking, Burstable VMs, and Update Manager.
Contents
Metrics available by default (Host)
OS metrics (require Azure Monitor Agent)
With Azure Monitor Agent (AMA) installed and a Data Collection Rule (DCR) configured, OS-level metrics are collected:
•Available and used memory (Windows and Linux)
•CPU per process, per logical core
•Disk: free space per volume, latency, I/O queue
•Network: packets sent/received, errors
•Custom Windows performance counters
•Syslog and Windows event logs
Key disk performance concepts
IOPS (Input/Output Operations Per Second)
Number of read/write operations per second. Critical for OLTP DBs with many small transactions.
Throughput (MB/s)
Amount of data transferred per second. Critical for large sequential read operations (ETL, analytics, video).
Latency (ms)
Time until an I/O operation completes. Ultra Disk and Premium SSD v2 guarantee <1ms. Premium SSD <10ms.
Disk Bursting
Premium SSD and Standard SSD support bursting: they can temporarily exceed their provisioned IOPS/throughput using credits accumulated during periods of low activity.
• On-demand bursting (Premium SSD P30+): unlimited burst, you pay for the extra IOPS used
• Credit-based bursting (Premium SSD P1-P20): you accumulate credits, time-limited
• VMs also have their own burst limits (per VM size)
Write Accelerator (M-series VMs)
Feature exclusive to M-series VMs (memory-optimized) for redo/transaction log disks of SAP HANA and SQL Server. Drastically reduces log write latency by keeping them in a high-speed write cache.
VM + Disk IOPS ceiling — the more restrictive limit wins
The actual performance of a disk is bound by the minimum between the disk limit AND the VM limit. If you have a Premium SSD P30 (5,000 IOPS) on a Standard_D2s_v3 (3,200 IOPS max), you only get 3,200 IOPS.
Common bottleneck: buying a Premium SSD disk but attaching it to a small VM. The disk has more capacity than the VM can leverage. Always check the IOPS/throughput limits of the chosen VM size.
Accelerated Networking (AN)
Enables SR-IOV (Single Root I/O Virtualization) on the VM: the virtual NIC accesses the network hardware directly without going through the hypervisor. Reduces latency and jitter, increases throughput.
• Without AN: packets travel VM → hypervisor → virtual switch → physical NIC
• With AN: packets travel VM → physical NIC directly (SR-IOV bypass)
• Typical latency: without AN ~100μs, with AN ~25μs
• Throughput: up to 30 Gbps with AN vs much less without it
• Enabled automatically on compatible VMs (D/E/F/M series v3/v4/v5)
Network limits per VM size
Each VM size has a network bandwidth limit (in Mbps or Gbps). Using more NICs does not exceed the size's limit — the limit belongs to the physical host shared by all NICs.
| VM Size | Max NICs | Bandwidth |
|---|---|---|
| B2s | 2 | 600 Mbps |
| D4s_v5 | 4 | 12.5 Gbps |
| D16s_v5 | 8 | 12.5 Gbps |
| E32s_v5 | 8 | 16 Gbps |
How credits work
B-series VMs have a CPU baseline (e.g., B2s = 40% baseline). When you use LESS than the baseline, you accumulate credits. When you need more CPU, you spend credits to "burst" up to 100%.
• Each credit = 1 minute of 100% CPU usage on 1 core
• Accumulation: depends on size (B1s accumulates 6 credits/hour)
• Maximum accumulated credits: varies by size (B1s: 144 credits = 24h of accumulation)
• Without credits: the VM is limited to the baseline — it cannot burst
Popular B-series table
| VM | vCPUs | RAM | Baseline | Cred/hour |
|---|---|---|---|---|
| B1s | 1 | 1 GB | 10% | 6 |
| B2s | 2 | 4 GB | 40% | 24 |
| B4ms | 4 | 16 GB | 90% | 54 |
| B8ms | 8 | 32 GB | 135% | 81 |
When NOT to use B-series
Sustained CPU workloads (compilation, rendering, ML, DBs with constant load). Credits run out and the VM becomes limited to the baseline.
Service for managing OS updates on Azure and on-premises VMs (via Azure Arc). Replaces Update Management from Azure Automation.
Capabilities
Patch Orchestration Modes
Manual
The OS applies patches only when the user starts it manually. Azure does not intervene.
AutomaticByOS
Windows Update or yum/apt decides when to patch according to its own schedule.
AutomaticByPlatform
Azure Update Manager manages the schedule. Allows maintenance windows. Recommended.
ImageDefault
Uses the mode configured in the OS image. Variable.
VM Insights
Pre-configured dashboard in Azure Monitor with performance metrics (CPU, disk, network, memory) and a dependency map between VMs. Requires Azure Monitor Agent.
VM → Insights → Enable. Provisions AMA and Log Analytics Workspace automatically.
Boot Diagnostics
Captures console screenshots and the boot log. Essential for diagnosing VMs that fail to boot or that hit a blue screen (BSOD).
VM → Boot diagnostics → Enable. Saved to a Storage Account (managed or your own).
Azure Diagnostics Extension
Legacy extension for sending OS metrics to Azure Monitor. Being replaced by Azure Monitor Agent (AMA). Still relevant for real-time guest OS metrics.
VM → Diagnostic settings → Enable. Select Storage Account or Log Analytics.
| Strategy | Potential savings | Trade-off | When to apply |
|---|---|---|---|
| Reserved Instances (1 year) | ~40% | 1-year commitment. Cancellation with penalty. | Stable production VMs, constant usage |
| Reserved Instances (3 years) | ~63% | 3-year commitment. | Highly predictable long-term workloads |
| Azure Hybrid Benefit | ~49% on OS license | Requires Windows Server licenses with SA. | If you already have on-prem licenses |
| Spot VMs | Up to 90% | No SLA. Azure can evict with 30 seconds notice. | Batch jobs, CI/CD, dev/test, renders |
| Auto-shutdown | Proportional to hours powered off | VMs unavailable outside scheduled hours. | Dev/test VMs not used 24/7 |
| Rightsizing | Variable (5-40% typical) | Requires prior metric analysis. | Oversized VMs with CPU consistently < 20% |
Azure Advisor — automatic recommendations
Azure Advisor analyzes your usage and generates cost recommendations. For VMs: identifies underutilized VMs (CPU < 5%) and suggests resizing or shutting down.
→ Portal → Advisor → Cost → VM recommendations
→ Also monitors: underutilized Reserved Instances, orphaned disks (no VM attached)
→ Estimates the monthly savings of each recommendation
Azure Dev/Test Labs
Managed environment for development teams. Enables scheduled auto-shutdown, per-user cost limits, pre-configured images, and Spot pricing for dev VMs.
→ Reduced pricing: Dev/Test VMs get a discount on Windows licenses
→ Quotas: limit the number of VMs per user and the maximum monthly cost
→ Policies: enforce auto-shutdown at 19:00 if no one is connected
Did you get this topic?
Test what you just learned
A development team has 20 VMs that are only used Monday through Friday between 9:00 AM and 6:00 PM. The VMs run Windows Server. The company has Windows Server licenses with Software Assurance. Which combination of strategies maximizes savings?
Put what you learned to the test with original AZ-104 exam questions.
Start AZ-104 mock examUnlimited mock exams with the Pro plan
Log in to track your progress.