Bitzu

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 az commands (e.g. az group create) in Bash, Cmd or PowerShell; returns JSON.
  • Azure PowerShell: cross-platform Az module, 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; $HOME on a 5-GB Azure Files share.

Source: https://learn.microsoft.com/en-us/cli/azure/choose-the-right-azure-command-line-tool

Practice questions

Single choice

Which command creates a resource group with Azure PowerShell?

  1. az group create
  2. New-AzResourceGroup
  3. kubectl create namespace
  4. 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.

Select all that apply

Which statements about Azure CLI and Azure PowerShell are true?

  1. Both can be installed on Windows, macOS and Linux
  2. Azure CLI can run in Bash and in Cmd
  3. Azure PowerShell needs Windows PowerShell or PowerShell
  4. Azure PowerShell runs only on Windows machines
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More AZ-900 topics in this module