AZ-900 ยท Managing and deploying resources
Cloud Shell, Azure CLI and Azure PowerShell
Browser-based Azure Cloud Shell with Bash or PowerShell, Azure CLI (az commands) vs Azure PowerShell (Az cmdlets) and scripting repeatable tasks.
Key points
- Azure CLI: cross-platform
azcommands (e.g.az group create) in Bash, Cmd or PowerShell; returns JSON. - Azure PowerShell: cross-platform
Azmodule, verb-noun cmdlets (e.g.New-AzResourceGroup); returns objects; Windows PowerShell or PowerShell. - Azure Cloud Shell: authenticated browser terminal (portal, shell.azure.com): Bash or PowerShell, both tools.
- 20 idle minutes timeout;
$HOMEon a 5-GB Azure Files share.
Source: https://learn.microsoft.com/en-us/cli/azure/choose-the-right-azure-command-line-tool
Practice questions
Which command creates a resource group with Azure PowerShell?
- az group create
- New-AzResourceGroup
- kubectl create namespace
- azcopy make
Show answer
Answer: B. New-AzResourceGroup
Azure PowerShell uses verb-noun cmdlets from the Az module, so the cmdlet is New-AzResourceGroup. az group create is the Azure CLI equivalent; the other two are not Azure resource group commands.
Which statements about Azure CLI and Azure PowerShell are true?
- Both can be installed on Windows, macOS and Linux
- Azure CLI can run in Bash and in Cmd
- Azure PowerShell needs Windows PowerShell or PowerShell
- Azure PowerShell runs only on Windows machines
- Azure CLI returns PowerShell objects by default
Show answer
Answer: A. Both can be installed on Windows, macOS and Linux, B. Azure CLI can run in Bash and in Cmd, C. Azure PowerShell needs Windows PowerShell or PowerShell
Both tools install on Windows, macOS and Linux. Azure CLI runs in Bash, Cmd and PowerShell, while the Az module needs Windows PowerShell or PowerShell. Azure PowerShell is not Windows-only, and Azure CLI returns JSON by default, not objects.
Azure Cloud Shell offers only Bash, so administrators who prefer PowerShell must install Azure PowerShell locally.
Show answer
Answer: False
False. Cloud Shell lets you choose Bash (with Azure CLI) or PowerShell (with Azure PowerShell) and switch between them from a drop-down at the top of the window.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
