# AZ-104 Lab 1 - Deploying My First Azure Virtual Machine

As part of my journey to earn the **Microsoft Azure Administrator Associate (AZ-104)** certification, I’ve started documenting my labs here on [**jmcnairtech.com**](http://jmcnairtech.com). Each lab showcases the real-world skills I’m learning to manage and deploy cloud infrastructure in Microsoft Azure.

In this first lab, I built a simple yet essential Azure environment — a **Virtual Network (VNet)** and a **Virtual Machine (VM)** — the basic foundation for everything else in cloud administration.

## Lab Objective

The goal of this lab was to deploy a **Windows Server 2022 virtual machine** inside a **secure virtual network** using best practices like:

* Organizing resources with a **Resource Group**
    
* Creating a **Virtual Network** and **Subnet**
    
* Deploying a **VM** with secure access controls
    
* Configuring **Network Security Groups (NSGs)**
    
* Enabling **monitoring and auto-shutdown**
    

This type of setup is the backbone of most Azure workloads — from application servers to lab environments.

## Step 1: Create a Resource Group

Resource Groups in Azure act as logical containers to organize and manage related resources.  
I started by creating a new group called `RG-Lab1-AZ104` in the **East US** region.

**Azure Portal → Resource groups → + Create**

* **Name:** RG-Lab1-AZ104
    
* **Region:** East US
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1761141654260/017fefc2-5377-4a55-93f6-34485671f03c.png align="center")

## Step 1.1: Add Tags for Organization and Cost Management

Before finishing the resource group setup, I added **tags** to help identify and manage my resources.

Tags in Azure are key-value pairs that make a big difference in real-world environments. They’re used for:

* **Cost tracking** — seeing how much each project or department spends
    
* **Automation** — applying policies or scripts based on tags
    
* **Organization** — grouping resources logically across regions and subscriptions
    

For this lab, I added these tags:

| Tag Name | Value | Purpose |
| --- | --- | --- |
| `Project` | `AZ104-Lab1` | Identifies the lab or project |
| `Environment` | `Test` | Marks this as a non-production environment |
| `Owner` | `Joshua McNair` | Notes who created or manages the resource |
| `Cost Center` | `Education` | Used to track the cost center for billing |

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1761141791587/c1f7ba3a-25ae-4001-b75b-c0c391ea03fe.png align="center")

Adding tags even in a small lab like this helps build good habits early — Azure administrators rely heavily on tagging for cost analysis and lifecycle management.

## Step 2: Create a Virtual Network (VNet) and Subnet

Next, I set up a private network for my virtual machine to live in.

**Azure Portal → Virtual Networks → + Create**

* **Name:** VNET-Lab1
    
* **Address space:** 10.0.0.0/16
    
* **Subnet:** Subnet-VMs (10.0.1.0/24)
    

This subnet acts like a private section of the network where the VM can securely communicate.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1761162566983/f9540de8-5aad-46f4-b631-63051d0bde05.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1761162906803/f74cefde-37b2-4b01-9fb9-7b54dfef3635.png align="center")

## Step 3: Deploy a Windows Server 2022 VM

With the network in place, I created a virtual machine inside that subnet.

**Azure Portal → Virtual Machines → + Create**

* **Name:** VM-Lab1-Server
    
* **Image:** Windows Server 2022 Datacenter (Gen2)
    
* **Size:** Standard\_D2 (lowest allowed at the time for Windows Server 2022 testing)
    
* **Username:** azureuser
    
* **Password:** (\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*)
    
* **Inbound ports:** RDP (3389)
    

After validation, I clicked **Create**, and Azure began provisioning the VM.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1761163898520/b2070a71-aecd-4712-ae4c-f0f8ed995594.png align="center")

## 🔌 Step 4: Connect to the VM

Once the deployment finished, I connected to the VM using Remote Desktop.

* From the VM overview page → **Connect → RDP**
    
* Downloaded the `.rdp` file and logged in using my credentials
    

Seeing the Windows Server desktop for the first time confirmed that the environment was working perfectly.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1761164556127/eb24c0e8-c022-4534-a6ec-56cf58d5d86a.png align="center")

## Step 5: Monitoring and Auto-Shutdown

While Azure Monitor VM Insights offers deeper performance tracking, I chose not to enable it for this lab to keep costs low and focus on foundational deployment skills. The default metrics provided by Azure — like CPU and disk usage — were sufficient for validating the VM’s health and connectivity.

* **Auto-shutdown:** Set for 7 PM daily
    

These features help simulate how administrators manage uptime and costs in real production environments.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1761165518044/0f86ac9a-4b5d-4db8-9531-de4bd5ed37bf.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1761164991816/d19e61e3-63b0-4304-9189-9bcebbd6c79a.png align="center")

## Step 6: Cleanup

Once testing was complete, I cleaned up my environment to avoid extra charges:

az group delete --name RG-Lab1-AZ104 --no-wait --yes

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1761165639441/14600d2c-5280-4150-aef7-acce5e82df09.png align="center")

Azure automatically removed every resource inside that resource group.

## What I Learned

* How Azure resources are logically grouped and connected
    
* The purpose of VNets, subnets, and NSGs in secure networking
    
* How to provision, connect to, and manage a Windows Server VM
    
* Why cost management and monitoring are essential for administrators
    

This lab helped me connect the dots between **core networking, resource management, and infrastructure deployment** — all key areas of the AZ-104 exam.

**Thanks for reading!**  
If you’re learning Azure too, follow along here on [**jmcnairtech.com**](http://jmcnairtech.com) — I’ll be posting new labs as I work toward the **AZ-104** and my goal of becoming an **Azure Administrator**.
