Challenge 21: Azure Cloud Shell, CLI & PowerShell
25-35 min | Cost: Free | Domain: Management & Governance (30-35%)
Exam skills covered
- Describe the Azure portal
- Describe Azure Cloud Shell (Azure CLI and Azure PowerShell)
Overview
Azure provides multiple ways to manage resources: the Azure Portal (web GUI), Azure CLI (cross-platform command line), and Azure PowerShell (PowerShell modules for Azure). Azure Cloud Shell runs both CLI and PowerShell directly in your browser — no local installation needed.
Explore
Task 1: Explore the Azure Portal
- Open portal.azure.com
- Familiarize yourself with key areas:
- Search bar (top): Find any service or resource
- Home: Quick access to recent resources
- All services: Browse every Azure service by category
- Dashboard: Customizable view of your environment
- Favorites (left sidebar): Pin frequently used services
- Try customizing your dashboard:
- Click + New dashboard or Edit
- Add tiles showing resource groups, service health, etc.
Task 2: Open Azure Cloud Shell
- In the Azure Portal, click the Cloud Shell icon (looks like
>_in the top toolbar) - If first time: select Bash or PowerShell (you can switch later)
- If prompted for storage: click Create storage (uses a small, free storage account)
- You now have a terminal in your browser!
Cloud Shell features:
- Pre-installed: Azure CLI, Azure PowerShell, Git, Python, Node.js, Terraform
- Persistent: 5 GB home directory storage
- Authenticated: Already logged into your Azure account
- Minimal cost: Requires a small storage account for persistence (~$0.01/month)
Task 3: Try Azure CLI commands
Switch to Bash in Cloud Shell, then run:
# See which account you're logged into
az account show --output table
# List all resource groups
az group list --output table
# List available Azure regions (first 10)
az account list-locations --query "[0:10].{Name:displayName, Geo:metadata.geographyGroup}" --output table
# Get help for any command
az vm --help
Azure CLI pattern: az <service> <action> --parameters
az vm create— create a VMaz group list— list resource groupsaz storage account show— show storage details
Task 4: Try Azure PowerShell commands
Switch to PowerShell in Cloud Shell, then run:
# See which account you're logged into
Get-AzContext
# List all resource groups
Get-AzResourceGroup | Format-Table
# List available VM sizes (first 10)
Get-AzVMSize -Location "eastus" | Select-Object -First 10
# Get help
Get-Help New-AzVM
Azure PowerShell pattern: Verb-AzNoun -Parameters
New-AzVM— create a VMGet-AzResourceGroup— list resource groupsRemove-AzStorageAccount— delete storage
Task 5: Compare management tools
| Tool | Best for | Available on |
|---|---|---|
| Azure Portal | Visual management, exploration, one-off tasks | Any browser |
| Azure CLI | Scripting (Bash), cross-platform automation | Windows, macOS, Linux, Cloud Shell |
| Azure PowerShell | Scripting (PowerShell), Windows automation | Windows, macOS, Linux, Cloud Shell |
| Azure Cloud Shell | Quick commands without local setup | Any browser |
| Azure Mobile App | Monitoring on-the-go | iOS, Android |
| REST API | Custom integrations, SDKs | Any language |
When to use what:
- Learning/exploring → Portal
- Repeating tasks → CLI or PowerShell (scriptable)
- CI/CD pipelines → CLI (cross-platform)
- Windows admin familiar with PowerShell → Azure PowerShell
Open Cloud Shell and run: az interactive for an enhanced CLI experience with auto-complete and inline documentation.
Key Concepts
| Concept | Description |
|---|---|
| Azure Portal | Web-based GUI for managing Azure resources |
| Azure CLI | Cross-platform command-line tool (az commands) |
| Azure PowerShell | PowerShell module for Azure (Verb-AzNoun commands) |
| Azure Cloud Shell | Browser-based terminal with CLI + PowerShell pre-installed |
| Infrastructure as Code | Manage infrastructure through scripts/templates (repeatable) |
| Idempotent | Running the same command twice produces the same result |
Knowledge Check
1. What is Azure Cloud Shell?
2. Which Azure management tool is best for tasks that need to be repeated automatically through scripts?
3. What is a key advantage of the Azure Portal over CLI tools?
4. Azure Cloud Shell requires which of the following to persist files between sessions?
5. The Azure CLI command pattern follows which format?