Skip to main content

Challenge 21: Azure Cloud Shell, CLI & PowerShell

Estimated Time

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

  1. Open portal.azure.com
  2. 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
  3. Try customizing your dashboard:
    • Click + New dashboard or Edit
    • Add tiles showing resource groups, service health, etc.

Task 2: Open Azure Cloud Shell

  1. In the Azure Portal, click the Cloud Shell icon (looks like >_ in the top toolbar)
  2. If first time: select Bash or PowerShell (you can switch later)
  3. If prompted for storage: click Create storage (uses a small, free storage account)
  4. 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 VM
  • az group list — list resource groups
  • az 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 VM
  • Get-AzResourceGroup — list resource groups
  • Remove-AzStorageAccount — delete storage

Task 5: Compare management tools

ToolBest forAvailable on
Azure PortalVisual management, exploration, one-off tasksAny browser
Azure CLIScripting (Bash), cross-platform automationWindows, macOS, Linux, Cloud Shell
Azure PowerShellScripting (PowerShell), Windows automationWindows, macOS, Linux, Cloud Shell
Azure Cloud ShellQuick commands without local setupAny browser
Azure Mobile AppMonitoring on-the-goiOS, Android
REST APICustom integrations, SDKsAny 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
Try it now!

Open Cloud Shell and run: az interactive for an enhanced CLI experience with auto-complete and inline documentation.

Key Concepts

ConceptDescription
Azure PortalWeb-based GUI for managing Azure resources
Azure CLICross-platform command-line tool (az commands)
Azure PowerShellPowerShell module for Azure (Verb-AzNoun commands)
Azure Cloud ShellBrowser-based terminal with CLI + PowerShell pre-installed
Infrastructure as CodeManage infrastructure through scripts/templates (repeatable)
IdempotentRunning 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?

Learn More