
Zero to Nginx: How I Built My First Azure Lab Using PowerShell
Building a cloud lab should be easy, but sometimes the cloud has other plans (looking at you, Quota limits!). After a few rounds of troubleshooting, I successfully deployed a Virtual Network and an Ubuntu VM running Nginx in Azure—all from the Cloud Shell. Here is the full step-by-step guide and the code to make it happen. 1. Setting the Stage (Variables) Instead of hardcoding names, we use variables. This makes the script reusable. $rgName = "my-automated-rg" $location = "eastus2" # Pivot to East US 2 for better availability $vnetName = "shared-vnet" $vmSize = "Standard_D2s_v3" # A reliable size with available quota 2. Create the Resource Group and Network First, we need a "folder" for our resources (Resource Group) and a private network (VNet) with a specific subnet. # Create Resource Group New-AzResourceGroup -Name $rgName -Location $location # Define Subnet $subConfig = New-AzVirtualNetworkSubnetConfig -Name "calab-subnet" -AddressPrefix "10.0.1.0/24" # Create VNet New-AzVirtualNet
Continue reading on Dev.to Tutorial
Opens in a new tab




