One of the most powerful features in Microsoft Azure isn’t found in the Azure Portal at all. It’s Azure Cloud Shell.
If you’re still deploying virtual machines by clicking through wizards, selecting drop-down menus, and manually entering network settings, you’re probably spending far more time than necessary.
As infrastructure professionals, we automate repetitive tasks whenever possible. That’s exactly where Azure CLI and Azure Cloud Shell shine.
What Is Azure Cloud Shell?
Azure Cloud Shell is a browser-based command-line environment hosted by Microsoft that comes preconfigured with Azure tools and authenticated to your Azure account.
In simple terms:
- No software to install
- No Azure CLI setup required
- No workstation dependencies
- Available from any web browser
Open Azure Cloud Shell and start building infrastructure immediately.
Why I Prefer Azure CLI Over the Azure Portal
Don’t get me wrong.
The Azure Portal is excellent for learning, troubleshooting, and exploring resources.
However, after deploying dozens or hundreds of servers, the portal becomes slow and repetitive.
Every VM deployment requires:
- Resource Groups
- Virtual Networks
- Subnets
- Network Security Groups
- Storage
- User Accounts
- VM Sizing
- Disk Configuration
That’s a lot of clicking.
Using Azure CLI, you can deploy the exact same infrastructure repeatedly with predictable results.
Benefits of Azure CLI
Faster Deployments
Instead of spending 10-15 minutes clicking through screens, deployments can occur in seconds.
Consistency
Every server is built using the same standards and configuration.
Repeatability
Need ten identical servers? Run the script ten times.
Documentation
Your scripts become living documentation.
Automation
Infrastructure deployments can become part of:
- CI/CD Pipelines
- Azure DevOps
- GitHub Actions
- Disaster Recovery Planning
- Infrastructure as Code Initiatives
What Can Be Automated?
The short answer: nearly everything.
Azure CLI can create and manage:
- Resource Groups
- Virtual Networks
- Subnets
- Network Security Groups (NSGs)
- Storage Accounts
- Managed Disks
- Virtual Machines
- Azure User Accounts
- Role Assignments
- Load Balancers
- Availability Sets
- Virtual Machine Scale Sets
Once you begin deploying infrastructure through code, it’s difficult to go back to manually creating resources through the portal.
A Real-World Example
Imagine a project manager asks for:
“I need a Windows Server with 4 CPU cores, 16 GB RAM, 128 GB of storage, and RDP access.”
A junior administrator might spend several minutes navigating the Azure Portal and filling out deployment screens.
An experienced infrastructure engineer can deploy the entire environment from Azure Cloud Shell in minutes.
Azure Cloud Shell Script Example
The following script creates:
- Resource Group
- Virtual Network
- Subnet
- Network Security Group
- Windows Server 2022 VM
- Public IP Address
- RDP Access Rule
The VM uses Standard_D4s_v5, which provides:
- 4 vCPUs
- 16 GB RAM
- 128 GB OS Disk
Important: Replace the password before running in production.
# Variables
LOCATION="eastus"
RESOURCEGROUP="RG-SysAdminFAQ"
VMNAME="VM-SYSADMINFAQ-01"
ADMINUSER="localadmin"
PASSWORD="ReplaceWithAStrongPassword123!"
# Create Resource Group
az group create \
--name $RESOURCEGROUP \
--location $LOCATION
# Create Virtual Network
az network vnet create \
--resource-group $RESOURCEGROUP \
--name VNET-SYSADMINFAQ \
--address-prefix 10.10.0.0/16 \
--subnet-name SERVERS \
--subnet-prefix 10.10.1.0/24
# Create Network Security Group
az network nsg create \
--resource-group $RESOURCEGROUP \
--name NSG-SERVERS
# Allow RDP Access
az network nsg rule create \
--resource-group $RESOURCEGROUP \
--nsg-name NSG-SERVERS \
--name Allow-RDP \
--priority 1000 \
--direction Inbound \
--access Allow \
--protocol Tcp \
--destination-port-ranges 3389
# Associate NSG with Subnet
az network vnet subnet update \
--resource-group $RESOURCEGROUP \
--vnet-name VNET-SYSADMINFAQ \
--name SERVERS \
--network-security-group NSG-SERVERS
# Deploy Windows Server 2022
az vm create \
--resource-group $RESOURCEGROUP \
--name $VMNAME \
--image Win2022Datacenter \
--size Standard_D4s_v5 \
--admin-username $ADMINUSER \
--admin-password $PASSWORD \
--vnet-name VNET-SYSADMINFAQ \
--subnet SERVERS \
--os-disk-size-gb 128 \
--public-ip-sku Standard
Why This Matters
The true power of Azure Cloud Shell isn’t deploying one server.
The true value comes when you need to deploy:
- 5 Domain Controllers
- 20 Application Servers
- 50 Web Servers
- 100 Virtual Machines
Instead of hours of repetitive clicking, everything can be standardized and automated.
You’ll spend less time creating infrastructure and more time improving it.
How Modern Infrastructure Teams Use Azure CLI
Many organizations use Azure CLI for:
- Build Automation
- Disaster Recovery Testing
- Server Standardization
- Lab Environments
- Dev/Test Deployments
- Azure DevOps Pipelines
- GitHub Actions Workflows
- Infrastructure as Code Projects
Automation helps eliminate inconsistencies while dramatically speeding up deployment times.
What Comes Next?
After becoming comfortable with Azure CLI, many administrators eventually move into more advanced Infrastructure as Code solutions such as:
- Terraform
- Bicep
- ARM Templates
- Azure DevOps
- GitHub Actions
However, Azure CLI remains one of the best ways to learn Azure resource creation and understand how different services connect together.
My Advice
If you’re a systems administrator looking to modernize your skillset, start using Azure Cloud Shell today.
Don’t begin with Terraform.
Don’t overcomplicate things.
Start by deploying:
- One Resource Group
- One Virtual Network
- One Network Security Group
- One Virtual Machine
Then build from there.
Before long, you’ll discover you’re deploying environments faster, more consistently, and with fewer mistakes than ever before.
And that is exactly why automation has become one of the most valuable skills for today’s cloud and infrastructure professionals.
Recommended Reading
- Microsoft Learn – Azure CLI Virtual Machine Commands
- Microsoft Learn – Network Security Groups
- Microsoft Learn – Azure VM Sizes
- Azure Citadel
- Microsoft Azure Blog
- OneUptime Azure Tutorials
What About You?
Are you still deploying Azure resources through the portal, or have you started automating your infrastructure using Azure CLI and Azure Cloud Shell?
Leave a comment below and share your favorite Azure automation tips with the SysAdminFAQ community.