Creating and Managing Virtual Machines- Part 2

IntermediateTopic20 min5 min readAzure

AZ-104 notes: Creating and Managing Virtual Machines- Part 2. Covers key concepts for the Azure Administrator Associate exam.

  • Structured Summary + Deep Technical Understanding

Primary service:

  • Azure Virtual Machines

Related services:

  • Azure Virtual Network
  • Azure Network Security Group
  • Azure Managed Disks
  • Nginx

Official documentation:

VM management overview:

Resize VM:

NSG rules:

Move resources:

1️⃣ VM Management Overview

  • Once a VM is deployed, administrators must manage it just like on-premise servers.

Common VM management operations include:

  • Authentication and remote access
  • Resizing compute resources
  • Managing networking
  • Managing storage disks
  • Installing applications/services
  • Diagnostics and monitoring
  • Moving resources between environments
  • These operations are similar to on-prem virtualization platforms like VMware or Hyper-V but are performed through Azure management tools.

2️⃣ Authentication and Remote Access

To manage a VM you must connect to it.

Linux VM

Connection method:

  • ssh username@public-ip

Uses:

  • SSH keys (recommended)
  • Password authentication

Windows VM

Connection method:

  • RDP (Remote Desktop Protocol)

Port:

  • 3389

Important concept:

  • Remote access requires the correct inbound network rules.

3️⃣ VM Networking Management

Each VM is connected to:

  • Virtual Network
  • Subnet
  • Network Interface (NIC)
  • Optional Public IP

Traffic filtering is controlled using:

  • Azure Network Security Group

Example NSG rules:

Example:

  • Allow SSH rule to connect to Linux VM.

4️⃣ VM Storage Components

Azure VMs use:

  • Azure Managed Disks

Disk types attached to VM:

OS Disk

Contains the operating system.

Temporary Disk

Ephemeral disk used for temporary storage.

Data Disk

  • Used for application data or databases.

Important exam concept:

  • Temporary disk data is lost during host migration or restart.

Docs:

5️⃣ Resizing a Virtual Machine

  • One common management task is resizing the VM.

Reasons to resize:

  • Increase CPU
  • Increase RAM
  • Reduce cost
  • Handle increased workload

Resize options depend on:

  • Region capacity
  • VM size family
  • Current VM state

Important Behavior

Resizing may require:

  • VM restart
  • Temporary downtime
  • Stopping the VM to access more size options

Example impact:

  • Running services may become unavailable temporarily.

Docs:

6️⃣ VM Deployment Using Azure CLI (Demo)

VM was created using:

  • az vm create

Key parameters used:

  • VM name
  • Resource group
  • OS image
  • Security configuration
  • SSH key authentication

Example concept:

  • If an incorrect image name is used, Azure CLI returns a list of supported images.

7️⃣ SSH Authentication Using Key-Based Access

After VM creation:

  • SSH keys are generated automatically.

Connection command:

  • ssh <public-ip>
  • Authentication happens using the stored private key in Cloud Shell.

Key advantage:

  • More secure than passwords.

8️⃣ Installing Applications on the VM

After connecting via SSH:

Example commands used:

  • sudo apt update
  • sudo apt install nginx -y

This installs:

  • Nginx

To verify service status:

  • sudo systemctl status nginx

9️⃣ Allowing Web Traffic to the VM

To access the web server:

  • An inbound NSG rule must allow HTTP.

Rule created:

  • Port: 80
  • Protocol: TCP
  • Source: Any (for demo purposes)

Once rule applied:

Access via browser:

  • http://<public-ip>
  • The Nginx default page confirms the web server is running.

🔟 VM Connectivity Troubleshooting

If SSH fails:

Check:

  • 1️⃣ NSG rule allows port 22 2️⃣ VM is running 3️⃣ Public IP exists 4️⃣ VM not currently resizing 5️⃣ Correct username and key

Example issue shown in demo:

  • SSH failed temporarily because VM was resizing.

1️⃣1️⃣ Moving a Virtual Machine

Azure supports moving resources between:

  • Resource Groups
  • Subscriptions
  • Regions (with restrictions)

Important limitation shown:

  • VM with Trusted Launch enabled cannot be moved across regions.

Trusted Launch provides:

  • Secure Boot
  • vTPM protection
  • Integrity validation

Docs:

Moving Between Resource Groups

  • Supported operation.

Steps:

  • 1️⃣ Select VM and related resources 2️⃣ Choose Move → Move to another resource group 3️⃣ Validate dependencies 4️⃣ Complete move operation

1️⃣2️⃣ VM Architecture Overview

Typical architecture:

  • VM
  • ├─ Managed OS Disk
  • ├─ Data Disk(s)
  • ├─ NIC
  • │ ├─ Private IP
  • │ └─ Optional Public IP
  • └─ Network Security Group

VM runs inside:

  • Azure Virtual Network

1️⃣3️⃣ Diagnostics and Monitoring

VM diagnostic features include:

  • Boot diagnostics
  • Performance metrics
  • Activity logs
  • Guest-level diagnostics

These help administrators troubleshoot:

  • Boot failures
  • Network connectivity
  • Resource usage
  • Application issues

Docs:

1️⃣4️⃣ Key Exam Concepts

Important concepts to remember:

✔ VM resizing may require restart ✔ SSH/RDP requires NSG rule ✔ Managed disks store VM data ✔ Temp disk data is not persistent ✔ NSG controls inbound traffic ✔ VM can be resized for performance or cost optimization ✔ Resource moves may have restrictions ✔ Trusted Launch prevents some migration operations

1️⃣5️⃣ Mental Model

Think of Azure VM management as:

Cloud version of managing a physical server:

  • Connect remotely
  • Install software
  • Adjust hardware resources
  • Configure networking
  • Secure access
  • But Azure handles the underlying infrastructure.

1️⃣6️⃣ Final Takeaways

  • ✔ Azure VMs require ongoing management after deployment ✔ SSH or RDP enables remote administration ✔ NSGs control traffic access ✔ VM resizing helps scale workloads ✔ Applications can be installed directly on the VM ✔ Storage consists of OS, temp, and data disks ✔ Moving VMs has platform limitations ✔ Trusted Launch improves security but limits mobility

If you'd like, I can also show you a **very useful AZ-104 cheat sheet for Azure **VMs, including:

  • VM availability sets vs zones
  • VM scale sets
  • VM pricing optimization
  • Bastion vs Public IP access
  • Disk performance tiers
  • This topic alone accounts for 20–30% of real Azure admin interviews.

More in Microsoft Azure