Build Your Own Cloud Dev Box on Azure (For the Cost of Coffee, Part II)

In the last post, we built a budget-friendly cloud development workstation on AWS—something powerful, secure, and cheap enough to run for about the cost of a couple coffees a month. This follow-up shows how to create the same experience on Azure, with the same goals:

  • No public IP
  • Secure remote access
  • VSCode Remote for daily work
  • Web development with easy local testing
  • Total cost around $20–30/month for ~40 hours a week of use

If you like the idea of your laptop becoming a light thin client—and your real dev machine living safely in the cloud—this guide will feel very familiar.


🧱 What We’re Building

Just like the AWS version, the Azure setup is:

  • Ubuntu 22.04/24.04 VM, mid-range
  • No public IP (much more secure)
  • Azure Bastion Developer SKU for SSH access
  • VS Code Remote – SSH for editing
  • SSH port forwarding for web dev
  • Premium SSD for speed
  • Costs that stay low by running it only when you’re working

Azure has great tooling for this, and the Developer SKU of Bastion is free, which makes the “no public IP” configuration easy.


💵 Monthly Cost Estimate (40 hrs/week)

Azure’s pricing varies a bit by region, but the numbers land right around this:

ComponentMonthlyNotes
B2ms VM (2 vCPU / 8 GB)~$14–15Pay-as-you-go, 173 hrs/mo
Premium SSD (64 GiB)~$7–8Fast, reliable managed disk
Bastion Developer SKU$0Free tier, perfect for SSH
Data egress~$0First 100GB/mo free
Total≈ $21–25Similar to AWS cost

At this level, you’re essentially renting a modern mid-range Linux workstation on demand, without the capital expense or replacement cycle of a laptop upgrade.


🛠️ Step 1: Create Your Azure Resource Group & Network

You’ll need:

  1. Resource Group (e.g., rg-cloud-devbox)
  2. Virtual Network (e.g., vnet-devbox)
  3. Private Subnet (e.g., subnet-dev-private)

Nothing here needs a public IP. Azure makes it easy to keep everything internal.


🖥️ Step 2: Create the VM (No Public IP)

In the Azure Portal:

  • Image: Ubuntu LTS (22.04 or 24.04)
  • Size: B2ms (2 vCPUs, 8 GB RAM)
  • OS Disk: Premium SSD, 64–128 GiB
  • NIC: No public IP
  • NSG Rules:
    • Allow SSH from VNet
    • Optionally allow Bastion service tag

This VM is completely private, which is exactly what we want.


🔐 Step 3: Enable Azure Bastion Developer for Secure SSH

Azure Bastion has multiple SKUs—Developer is perfect here. It gives you:

  • SSH to private VMs
  • No public IP
  • No exposed ports
  • Zero cost

Attach a Bastion host to your VNet (Developer SKU), then connect to your VM right from the Azure Portal using “Bastion → SSH.”

You now have secure, browser-based SSH with no public exposure.


👨‍💻 Step 4: Install Your Dev Tools

Inside the VM:

sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential git curl unzip tmux htop

For JavaScript/TypeScript dev:

curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install --lts

You can install Docker, Python, Go—whatever your stack requires.


🧑‍🎨 Optional: Add a Lightweight GUI

You don’t need a GUI if you use VS Code Remote, but if you’d like to occasionally RDP into a desktop:

sudo apt install -y xfce4 xrdp
sudo systemctl enable xrdp --now

Then connect via Bastion → RDP.
Azure handles the secure tunneling automatically.


✨ Step 5: VS Code Remote + Port Forwarding

This is where the workflow feels like magic.

On your laptop:

  1. Install VS Code
  2. Install Remote – SSH extension
  3. Connect to your VM using the Bastion-based SSH target
  4. VS Code opens a full environment on the Azure VM

Need to test a web app running on the VM?

Start your dev server:

npm run dev -- --port 3000
# or Django:
# python manage.py runserver 127.0.0.1:8000

VS Code detects the port automatically, or you can forward it manually:

ssh -L 3000:localhost:3000 <your-vm>

Then, on your local laptop:

http://localhost:3000

Boom—you’re testing code running in Azure through your local browser.


🗄️ Step 6: Backups, Safety, and Peace of Mind

Azure gives you:

Snapshots

Instant point-in-time backups of your VM disk.

No Public IP Exposure

No attack surface. Nothing to scan or brute force.

Your Laptop Can Die Tomorrow

And your whole environment survives untouched in Azure.

Cloneable Dev Boxes

Snapshots → new VMs allow you to:

  • Spin up a second dev box
  • Version your environments
  • Recreate everything after experiments or mistakes

This is a massive improvement over relying on a single laptop or desktop.


💡 Why Do This At All?

Just like with AWS:

  • Turn your $300 laptop into a gateway to a powerful dev machine
  • No more fans, heat, or worrying about battery
  • Code anywhere—from a Chromebook, tablet, borrowed PC, or hotel WiFi
  • No expensive hardware upgrades
  • No risk of losing your dev environment to theft or damage
  • Perfect isolation for work, learning, side projects, or client-specific stacks

It’s a superpower once you try it.


🔚 Wrapping Up

Now you have a secure, mid-range cloud dev box on Azure that:

  • Costs about $21–25/month
  • Requires zero public IPs
  • Uses VS Code Remote for a smooth workflow
  • Lets you test web apps through local port forwarding
  • Protects your work, even if your laptop falls into a lake

If you’ve built the AWS version from the previous post, you’ll find the Azure one just as capable—and even nicer in some ways thanks to Bastion Developer.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *