Azure Cloud Shell is a free, browser-based shell that lets you manage Azure resources without installing anything on your computer. When you open Cloud Shell from the Azure portal or visit shell.azure.com, you get a ready-to-use environment with all the tools already installed and your account automatically connected. The shell provides two environments: Bash for Azure CLI commands and PowerShell for Azure PowerShell commands, and you can switch between them with a toggle button.
A key feature of Cloud Shell is persistent storage, which uses an Azure Files share to keep your scripts, configuration files, and SSH keys safe across different sessions. This means when you close Cloud Shell and come back later, your files are still there. The storage share is created automatically the first time you use Cloud Shell, so you never have to worry about setting it up yourself.
Cloud Shell removes the need to install tools locally, which saves time and avoids version conflicts between different machines. You can copy commands from Azure documentation and paste them directly into Cloud Shell using keyboard shortcuts like Ctrl+Shift+V on Windows or Cmd+Shift+V on macOS. This makes it easy for beginners to start managing Azure resources quickly.
Azure CLI is a cross-platform command-line tool that works on Windows, macOS, and Linux, as well as inside Cloud Shell. The tool uses commands that start with az followed by a group name and a command name, such as az group create --name MyGroup --location eastus. The group identifies the Azure service you want to manage, and the command specifies what action you want to perform. You can add --help to any command to see its full syntax and available options.
Azure CLI is designed for automation and scripting. Common commands include az group create to create a resource container, az vm create to deploy a virtual machine, and az sql db create to build a database. These commands return JSON output by default, which makes it easy to parse the results in scripts or send them to other tools. The CLI integrates well with CI/CD pipelines because you can run the same commands on any machine.
To get started with Azure CLI in Cloud Shell, verify that Bash is selected as your environment, then type commands directly. You can set your active subscription with az account set -s , and you can store values in variables to reuse them in scripts. This flexibility lets you build automation workflows that deploy and manage Azure resources without manual steps.
Azure PowerShell is a set of PowerShell modules that provide cmdlets for managing Azure resources. Cmdlets are specialized commands that follow a verb-noun pattern, such as Get-AzVM to list virtual machines, New-AzResourceGroup to create a resource group, and Set-AzContext to switch subscriptions. Because PowerShell returns .NET objects instead of text, you can manipulate data more easily and chain commands together in powerful ways.
Azure PowerShell integrates smoothly with existing Windows workflows and DevOps pipelines. You can write scripts to automate repetitive tasks like creating multiple virtual machines, attaching managed disks, or cleaning up resources after testing. For example, you might use Set-AzContext to select the right subscription, then run New-AzDisk to create a disk, and finally execute New-AzVM -ResourceGroupName RG -Name VM1 -AttachOsDisk $diskId to deploy a VM with that disk attached.
The scripting capabilities of Azure PowerShell offer several benefits. Scripts provide repeatability because you can run the same automation multiple times with consistent results. They ensure consistency by applying the same settings across all resources. You can also embed scripts into CI/CD pipelines for continuous deployment. Since Cloud Shell hosts PowerShell with all modules preinstalled, you never need to worry about updating tools locally.
Both Azure CLI and Azure PowerShell let you authenticate to Azure, create resources, and configure role-based access control, but they differ in syntax and design. Azure CLI uses simple az commands optimized for Bash environments, while Azure PowerShell uses Az- cmdlets that work natively in PowerShell. Both tools can run locally on your machine or inside Cloud Shell, and both support authentication via az login or Connect-AzAccount.
Choose Azure CLI when you need quick, cross-platform tasks or simple automation scripts. Its straightforward command structure and JSON output make it ideal for CI/CD pipelines and scenarios where you need to parse results programmatically. Choose Azure PowerShell when you need complex pipelines, deep integration with Windows environments, or advanced scripting features like rich object manipulation and strong error handling.
In practice, many teams use both tools together to take advantage of their different strengths. You might use Azure CLI for one automation task because it fits naturally into your Bash scripts, and Azure PowerShell for another task because it integrates better with your existing PowerShell workflows. The ability to switch between Bash and PowerShell environments inside Cloud Shell makes it easy to use whichever tool suits the job.
Azure Cloud Shell, Azure CLI, and Azure PowerShell work together to handle real-world management tasks efficiently. For example, you can authenticate with az login or Connect-AzAccount, set your subscription with az account set or Set-AzContext, and then deploy resources with commands like az vm create or New-AzVM. To clean up after testing, use az group delete or Remove-AzResourceGroup to remove entire environments at once.
A common workflow involves setting up a container host. First, deploy an Ubuntu virtual machine using either Azure CLI or Azure PowerShell. Then, connect to the VM and run commands like sudo apt update and sudo apt install docker.io to install Docker. Finally, verify the installation with sudo docker run hello-world. This automation ensures you can reproduce the same setup whenever needed.
Best practices for using these tools include organizing resources in resource groups for easier lifecycle management, using user-assigned identities for authentication instead of storing credentials, and keeping your tools current with commands like az upgrade or Update-Module -Name Az. These steps help maintain secure, consistent, and efficient management of your Azure resources.
Start here! Get your feet wet with the Microsoft cloud and begin your journey to earning your Microsoft Certified: Azure Fundamentals certification!
Gauge your current knowledge

Gauge your current knowledge
