แก้ไข

แชร์ผ่าน


Get started with Azure Cloud Shell

This document details how to get started using Azure Cloud Shell.

Prerequisites

Before you can use Azure Cloud Shell, you must register the Microsoft.CloudShell resource provider. Access to resources is enabled through provider namespaces that must be registered in your subscription. You only need to register the namespace once per subscription.

To see all resource providers, and the registration status for your subscription:

  1. Sign in to the Azure portal.

  2. On the Azure portal menu, search for Subscriptions. Select it from the available options.

  3. Select the subscription you want to view.

  4. On the left menu, under Settings, select Resource providers.

  5. In the search box, enter cloudshell to search for the resource provider.

  6. Select the Microsoft.CloudShell resource provider register from the provider list.

  7. Select Register to change the status from unregistered to Registered.

    Screenshot of selecting resource providers in 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.

    Note

    By following these steps, Cloud Shell creates a standard storage account and allocates 5 GB of storage for the file share. You can also create a storage account manually and specify the storage account and file share to use. If you use a Premium storage account, Cloud Shell allocates 100 GB of storage for the file share.

Select your shell environment

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

Screenshot showing the shell selector.

Set your subscription

  1. List subscriptions you have access to.

    az account list
    
  2. Set your preferred subscription:

    az account set --subscription 'my-subscription-name'
    

Tip

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.

az

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

az webapp --help

Next steps