Azure Series: Part 02

Day 2 Operations: Connectivity & Scaling

Mastering Public IPs, Azure DNS, Managed Disks, and VM Resizing

"Welcome back! In Part 01, we built our foundation. Today, I’m showing you how I handle 'Day 2' tasks—the real-world management of IP addresses, domain names, and resource scaling that keeps a production environment running smoothly."

1. Establishing Permanent Connectivity

Before scaling my resources, I need to ensure that my users can always find my application. By default, Azure Public IPs can be dynamic, which is a risk for production.

IP Configuration

Transitioning to Static Public IP

I always switch my MAHARJAN-WEB-APP Public IP from 'Dynamic' to 'Static'. This ensures that even if I stop the VM or resize it, the IP address remains the same, preventing any DNS breaks.

Azure Static IP Configuration

Mapping the Domain with Azure DNS

With a Static IP in place, I use Azure DNS to map my domain name. I create a DNS Zone and point my registrar's name servers to Azure. Then, I configure the following records:

Record Type Name Value / Target Reason
A Record @ (Root) Static Public IP Maps domain to the VM
CNAME www maharjan-tech.com Alias for web traffic

2. Managed Disk Management of OS Disk (Scaling Storage)

When storage hits its limit, I follow a strict three-phase process to expand my disks without losing data.

My Safety Rule: I always take a Disk Snapshot before resizing. This is my 'Undo' button in case the filesystem expansion goes wrong.
Step 1

Azure Portal Resize

I start by Deallocating the VM. Then, under Disks > Size + Performance, I increase the GiB capacity. Azure expands the physical container, but we aren't done yet!

VM Deallocating Disk size increases Azure disk Verify
Step 2

OS-Level Volume Extension

After restarting, I log into the VM. In Windows Disk Management, the new space appears as 'Unallocated'. I right-click my volume and select Extend Volume to claim that space.

Windows Disk Management Extension Windows Disk Management Extension

3. VM Resizing (Vertical Scaling)

Sometimes CPU or RAM is the bottleneck. When my performance metrics show high usage, I perform a VM Resize.

The Workflow

Choosing a New Tier

I move from a general-purpose DS1_v2 to a memory optimized DS11_v2. This gives me much more consistent throughput for production workloads.

VM Resize Selection VM Resize Verification VM Resize Verification
Planning: Resizing the Virtual Machine may take 10-15 minutes depending upon the VM Sizes. Plan accordingly.

Impact Analysis

I always communicate these impacts to stakeholders before I hit 'Resize':

4. Upgrade Disk Size

When storage gets full and requires an increase in disk size, especially when naming conventions are missing, follow these steps:

Step 1

Identify the Correct Disk

I found some organizations do not manage the Azure disk name with proper Naming Conventions, making it difficult to map with server disk partition names. To resolve this, I need to identify the correct disk via LUN Number.

1. Find the LUN in the Azure Portal
Identify which LUN is assigned to your Azure Disk: Navigate to the Azure Portal > Select VM > Settings > Disks. The LUN column shows the number (0, 1, 2, etc.) associated with each disk name.

2. Map in PowerShell
Use the following commands to match the LUN from the portal to the Drive inside Windows:

Get-Disk | Select-Object Number, Location, Size

# Refined mapping script:
Get-Disk | ForEach-Object {
    $disk = $_
    $partitions = Get-Partition -DiskNumber $disk.Number | Where-Object DriveLetter
    foreach ($part in $partitions) {
        [PSCustomObject]@{
            DiskNumber  = $disk.Number
            LUN         = ($disk.Location -split "LUN ")[1]
            DriveLetter = $part.DriveLetter
            SizeGB      = [Math]::Round($disk.Size / 1GB, 2)
        }
    }
}
LUN in Portal LUN in Console
Step 2

Disk Upgrade

From the Azure portal, increase the disk size.

Disk Upgrade Windows Disk Management Extension
Warning: I recommend increasing the disk size only as required; once upgraded to a higher disk tier, it cannot be reduced.

Conclusion & Key Takeaways

Managing Azure infrastructure requires a proactive approach to connectivity and resource management. Here are the core pillars to remember: