Quickstart for Azure Cloud Shell

This document details how to use Bash and PowerShell in Azure Cloud Shell from the Azure portal.

Start Cloud Shell

  1. Launch Cloud Shell from the top navigation of the Azure portal.

    Screenshot showing how to start Azure Cloud Shell in the Azure portal.

    The first time you start Cloud Shell you're prompted to create an Azure Storage account for the Azure file share.

    Screenshot showing the create storage prompt.

  2. Select the Subscription used to create the storage account and file share.

  3. Select Create storage.

Select your shell environment

Cloud Shell allows you to select either Bash or PowerShell for your command-line experience.

Screenshot showing the shell selector.

Registering your subscription with Azure Cloud Shell

Azure Cloud Shell needs access to manage resources. Access is provided through namespaces that must be registered to your subscription. Use the following commands to register the Microsoft.CloudShell namespace in your subscription:

az account set --subscription <Subscription Name or Id>
az provider register --namespace Microsoft.CloudShell


You only need to register the namespace once per subscription.

Set your subscription

  1. List subscriptions you have access to.
az account list
  1. Set your preferred subscription:
az account set --subscription 'my-subscription-name'


Your subscription is remembered for future sessions using /home/<user>/.azure/azureProfile.json.

Get a list of Azure commands

Run the following command to see a list of all Azure CLI commands.


Run the following command to get a list of Azure CLI commands that apply to WebApps:

az webapp --help

Next steps