Azure provides several mechanisms to ensure that virtual machines (VMs) stay available and can scale up or down depending on demand.
Used to distribute VMs across multiple fault domains and update domains in a single Azure datacenter.
Protects against:
Hardware failures (fault domains)
Planned maintenance updates (update domains)
Ideal for multiple-tier applications needing high uptime.
A minimum of two or more VMs is required to gain the redundancy benefit.
VMs in an availability set:
Are spread across multiple physical racks
Receive rolling updates, not all at once
Provide higher availability than availability sets.
Azure regions are divided into physically separate zones, each with its own power, cooling, and networking.
You deploy VMs to specific zones (e.g., Zone 1, Zone 2, Zone 3).
If one zone fails, others can continue operating.
Use cases:
Mission-critical workloads
Low-latency replication between zones
Used to deploy and manage a group of identical, auto-scaling VMs.
Supports:
Manual or automatic scaling
Integration with Azure Load Balancer or Application Gateway
Benefits:
Built-in load balancing
Support for custom images
Rolling upgrades and health probes
Perfect for stateless applications like web servers or batch jobs.
Azure Load Balancer distributes incoming traffic to VMs.
Use with:
Availability Sets to balance traffic across healthy VMs
Availability Zones to direct traffic to active zones
Use Basic or Standard Load Balancer depending on scale/security needs.
This section covers how to deploy virtual machines, how to size and connect them, and how to extend their capabilities.
GUI-based method for beginners.
Walk-through wizard helps you configure:
Image (OS)
Size (SKU)
Disks
Networking
Management features
Best for manual or one-time deployments.
az vm create)Lightweight, scriptable option for developers or DevOps engineers.
Example:
az vm create \
--resource-group MyRG \
--name MyVM \
--image UbuntuLTS \
--admin-username azureuser \
--generate-ssh-keys
Ideal for Windows admins comfortable with scripting in PowerShell.
Offers full control with scripting and loops.
Infrastructure-as-Code using JSON.
Declarative: define what you want, not how.
Great for repeatable and standardized deployments.
Open-source IaC tool, cloud-agnostic.
Preferred in multi-cloud environments.
Uses its own configuration language (.tf files).
Best for DevOps teams managing large, repeatable infrastructure setups.
Azure offers many VM sizes (SKUs), grouped by series:
| Series | Use Case |
|---|---|
| B-series | Burstable, low-cost workloads |
| D-series | General purpose, good for most apps |
| E-series | Memory-intensive apps (databases) |
| F-series | CPU-intensive tasks (gaming, analytics) |
| N-series | GPU-intensive tasks (AI, ML, rendering) |
Choose based on workload profile (CPU-bound, memory-bound, etc.)
You can resize a VM if performance or cost needs change.
Limits:
Must deallocate VM first
Target size must be available in the region and hardware cluster
Steps:
Go to VM > Size > Resize
Pick a new SKU
Restart VM if required
OS Disk: Attached by default (contains Windows or Linux OS)
Data Disks: Optional; for storing app files, databases, logs
You can attach multiple data disks based on the VM size
Disks are managed by Azure and come in various types (next section)
| Type | Description | Use Case |
|---|---|---|
| Standard HDD | Low-cost, high-latency | Backup, infrequent access |
| Standard SSD | Better performance than HDD | Web servers, dev/test |
| Premium SSD | High performance | Production apps |
| Ultra Disk | High IOPS and low latency | Databases, OLTP workloads |
Choose based on performance needs and budget.
Azure uses Azure Disk Encryption (ADE) for encrypting VM disks.
For Windows: uses BitLocker
For Linux: uses DM-Crypt
You can choose:
Microsoft-managed keys
Customer-managed keys in Azure Key Vault
Encryption is important for compliance and data protection.
Dynamic IP: Changes upon VM restart (default for most VMs)
Static IP: Stays fixed; useful for DNS or firewall rules
Used to control inbound and outbound traffic.
Rules define:
Priority
Protocol
Source/destination
Port
Allow/Deny
Attach NSGs to:
Subnets (broader control)
NICs (per-VM control)
All VMs must be deployed inside a Virtual Network (VNet).
VNets are divided into subnets.
Subnets can host:
VMs
Gateways
App Services with VNet integration
Extensions are small programs that run inside a VM to perform tasks such as:
Post-deployment configuration
Monitoring
Security scanning
| Extension | Use |
|---|---|
| Custom Script Extension | Run PowerShell or shell scripts after deployment |
| Azure Monitor Agent | Collect performance and diagnostic data |
| Diagnostics Extension | Collects boot diagnostics and crash data |
Use extensions to automate software installs, deploy agents, or register VMs with monitoring services.
Automation is essential for consistency, scalability, and repeatability in Azure environments. Azure offers several tools to automate the deployment of virtual machines.
ARM (Azure Resource Manager) templates are JSON files that define your infrastructure as code.
They allow you to deploy and configure Azure resources declaratively.
ARM templates are ideal for:
Enforcing consistent environments across dev/test/prod
Deploying entire applications or infrastructure stacks
| Element | Description |
|---|---|
| Parameters | Input values you can provide during deployment |
| Variables | Reusable values, often derived from parameters |
| Resources | Definitions of Azure services to deploy (e.g., VMs, NSGs, storage) |
| Outputs | Return values after deployment (e.g., VM IP address) |
"resources": [
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2021-07-01",
"name": "[parameters('vmName')]",
"location": "[resourceGroup().location]",
"properties": {
"hardwareProfile": {
"vmSize": "Standard_B2s"
}
}
}
]
It allows you to run scripts automatically on a VM after it’s provisioned.
Scripts can:
Install software
Modify system settings
Perform configuration steps
Very useful in automated deployment pipelines.
Install Apache on a Linux VM using a shell script:
#!/bin/bash
apt-get update
apt-get install apache2 -y
Upload the script to Azure Storage and reference it in the extension:
"fileUris": ["https://<storageaccount>.blob.core.windows.net/scripts/install-apache.sh"]
A Linux-specific initialization tool used for automating configuration during VM provisioning.
It uses YAML syntax.
Create users
Set hostnames
Install packages
Configure network or SSH settings
#cloud-config
users:
- name: azureuser
groups: sudo
shell: /bin/bash
ssh-authorized-keys:
- ssh-rsa AAAAB3NzaC...
packages:
- nginx
runcmd:
- systemctl start nginx
You pass this YAML file during VM creation via the Azure Portal, CLI, or Terraform.
Azure provides tools to run and manage containers without needing to manage virtual machines directly. This section introduces two key services: Azure Container Instances (ACI) and Azure Kubernetes Service (AKS).
Azure Container Instances allow you to run containers directly in Azure without provisioning or managing VMs.
It’s a serverless container service, best for:
Running single containers or simple applications
Short-term or batch jobs
Testing and development
Fast startup (containers launch in seconds)
Per-second billing
Supports Linux and Windows containers
Supports public IPs, DNS, environment variables
Using Azure CLI:
az container create \
--resource-group myResourceGroup \
--name myContainer \
--image mcr.microsoft.com/azuredocs/aci-helloworld \
--cpu 1 --memory 1 \
--dns-name-label myacilabel --ports 80
This deploys a container running a basic web server, accessible via a DNS name.
Public IP: Exposes the container to the internet
VNet Integration: Runs container privately inside a Virtual Network (for secure internal access)
AKS is a managed Kubernetes service in Azure. Kubernetes is an open-source platform for orchestrating containers.
In AZ-104, you are only expected to understand the basics, not in-depth AKS operations.
| Concept | Description |
|---|---|
| Node pool | A group of VMs (nodes) that run containerized apps |
| Scaling | AKS can automatically scale node pools based on demand |
| Azure AD integration | Use Azure AD for Kubernetes API authentication |
| Helm | A package manager for Kubernetes apps |
Complex, multi-container applications
Apps requiring load balancing, auto-scaling, service discovery
Production workloads with microservices architecture
AKS is best when you need full control over container lifecycle and orchestration.
Azure provides Platform as a Service (PaaS) options for deploying and managing web applications with minimal infrastructure management.
The primary service is Azure App Service.
Azure App Service lets you deploy web applications and APIs without managing servers or virtual machines.
Key features:
Fully managed infrastructure
Autoscaling and high availability
Continuous deployment support (GitHub, Azure DevOps, etc.)
Built-in monitoring and diagnostics
.NET / .NET Core
Node.js
Python
Java
PHP
Also supports custom containers (Docker)
Used for safe deployment and testing.
You can create multiple slots like:
Staging
Testing
Production
You can swap slots to move new code into production with no downtime.
Define key/value pairs used by your app at runtime.
Used for:
App behavior customization
Connection strings to databases or storage
Environment variables are injected into the app runtime.
You can set them from:App Service > Configuration
App Service integrates with identity providers like:
Azure Active Directory
This provides secure user authentication without writing custom login code.
Steps:
Go to App Service > Authentication
Enable App Service Authentication
Choose your identity provider
Configure client IDs/secrets
Azure App Services support multiple scaling options:
App Service can automatically scale based on:
CPU usage
Memory usage
HTTP queue length
Time schedule (e.g., scale up during business hours)
Define rules under:App Service Plan > Scale out (App Service Plan)
| Tier | Features |
|---|---|
| Free / Shared | Test only; very limited resources |
| Basic | Custom domains, SSL |
| Standard | Autoscaling, backups |
| Premium | Enhanced performance, VNet integration, more slots |
| Isolated | Runs in a VNet for maximum security (App Service Environment - ASE) |
Enable detailed error messages, HTTP logs, and App logs for troubleshooting.
Use Application Insights for:
Performance tracking
Exception logging
Live metrics stream
Enable from:App Service > Monitoring > Diagnostics settings
App Services support automatic backups (in Standard tier or higher).
You can back up:
Web app content
Database connections
Configuration settings
Restore from backups through the portal if needed.
Azure provides multiple mechanisms to monitor performance and diagnose issues for virtual machines.
Collected through Azure Monitor, including:
CPU usage
Disk IOPS and latency
Network in/out
Available memory (Windows only)
Access via:
VM > Monitoring > Metrics
Azure Monitor > Metrics
To collect guest-level metrics and logs:
Enable diagnostic settings on the VM.
Install Azure Monitor Agent (AMA) or Diagnostics extension.
Perf
| where ObjectName == "Processor"
| where CounterName == "% Processor Time"
| where InstanceName == "_Total"
| summarize avg(CounterValue) by bin(TimeGenerated, 5m)
Use this to analyze CPU patterns over time.
Exam Tip: Know the difference between platform metrics (available without agent) and guest metrics (require agent or extension).
Run Command allows administrators to execute remote scripts or commands on a VM without RDP/SSH.
Fix broken extensions
Reset services
Run administrative scripts remotely
Virtual Machine > Operations > Run Command
Choose:
Windows: RunPowerShellScript
Linux: RunShellScript
az vm run-command invoke \
--resource-group MyRG \
--name MyVM \
--command-id RunShellScript \
--scripts "sudo apt update && sudo apt install nginx -y"
Exam Tip: This is often tested in scenarios where SSH or RDP access is unavailable.
While AZ-104 doesn’t cover deep AKS admin tasks, you should understand how Azure RBAC integrates with AKS.
Azure AD is used to authenticate users to AKS cluster control plane.
RoleBindings or ClusterRoleBindings authorize access via Kubernetes RBAC.
During cluster creation:
--enable-aad and specify --aad-admin-group-object-ids for admin group(s).Assign Azure user to a group with Azure Kubernetes Service Cluster User role.
Use kubectl with AAD authentication to access the cluster.
Exam Tip: You may be asked which Azure role is needed to access AKS using kubectl → Azure Kubernetes Service Cluster User.
VMSS supports automated VM updates via defined upgrade modes.
| Mode | Description |
|---|---|
| Manual | Admin must trigger updates; safest option |
| Automatic | VMs updated as soon as a new version is available |
| Rolling | VMs updated gradually, with health probes and batch control |
Health probe integration ensures only healthy instances are upgraded.
Settings:
Max batch size
Pause between batches
Failure thresholds
Exam Tip: Know the difference between these types—especially Manual vs Rolling.
Captures screenshot and console logs from a VM’s boot process.
Useful when OS fails to boot or VM becomes unresponsive.
Enable from:VM > Support + Troubleshooting > Boot Diagnostics
Provides a command-line interface via the Azure portal, even when RDP/SSH is unavailable.
Works if:
Boot diagnostics are enabled
VM OS supports it (e.g., Linux, Windows Server 2016+)
Path:VM > Serial Console
Use Cases:
Reset admin password
Modify fstab or firewall rules
Repair misconfigured startup scripts
Exam Tip: Expect a question involving troubleshooting boot failure, with clues pointing to serial console or boot diagnostics usage.
What is the main difference between Azure Availability Sets and Virtual Machine Scale Sets?
Availability Sets improve VM reliability across failure domains, while Virtual Machine Scale Sets enable automated scaling of identical VM instances.
Availability Sets distribute virtual machines across multiple fault domains and update domains to reduce the impact of hardware failures or maintenance. However, they do not automatically scale VM instances. Virtual Machine Scale Sets allow administrators to deploy and manage large sets of identical VMs that can automatically scale based on demand or metrics such as CPU usage. Scale sets are commonly used for applications requiring elasticity, while availability sets are used for improving redundancy in smaller deployments.
Demand Score: 87
Exam Relevance Score: 93
Why might an administrator be unable to connect to an Azure virtual machine via RDP or SSH after deployment?
A network security group rule may be blocking inbound traffic to the VM.
Network Security Groups control inbound and outbound traffic at the subnet or network interface level. If no rule allows inbound traffic on the required port (such as TCP 3389 for RDP or TCP 22 for SSH), the connection will fail. Administrators should verify that the NSG associated with the VM or subnet contains a rule allowing the required port and source IP range. This issue commonly occurs when security rules are modified or when a VM is deployed into a subnet with restrictive NSG policies.
Demand Score: 84
Exam Relevance Score: 91
In which scenario is Azure Container Instances more appropriate than Azure Kubernetes Service?
For simple, short-lived container workloads that do not require full container orchestration.
Azure Container Instances allow containers to run without managing servers or Kubernetes clusters. They are ideal for batch jobs, testing environments, or event-driven workloads that require fast startup and minimal infrastructure management. Azure Kubernetes Service is designed for complex containerized applications requiring orchestration, scaling, service discovery, and advanced networking. Therefore, ACI is typically used for lightweight workloads, while AKS is used for large production container platforms.
Demand Score: 82
Exam Relevance Score: 90
What is the purpose of Azure VM extensions?
VM extensions automate configuration and management tasks on virtual machines after deployment.
VM extensions allow administrators to install software, configure settings, or run scripts on a virtual machine without manual login. Common examples include the Custom Script Extension for running automation scripts, the Azure Monitor Agent for collecting telemetry, and security extensions for endpoint protection. Extensions simplify post-deployment configuration and enable consistent configuration across multiple virtual machines.
Demand Score: 79
Exam Relevance Score: 88
What deployment method allows repeatable infrastructure creation in Azure using code?
Azure Resource Manager (ARM) templates or Bicep.
Infrastructure as Code in Azure is typically implemented using ARM templates or Bicep files. These declarative templates define resources, configurations, dependencies, and parameters. When deployed, Azure Resource Manager ensures that resources are created consistently and idempotently. This approach improves automation, version control, and reproducibility of environments. It is commonly used in DevOps pipelines to deploy infrastructure across multiple environments.
Demand Score: 78
Exam Relevance Score: 92