Azure Cloud Shell 的概觀Overview of Azure Cloud Shell

Azure Cloud Shell 是可經由瀏覽器存取的已驗證互動式殼層,應用在 Azure 資源管理上。Azure Cloud Shell is an interactive, authenticated, browser-accessible shell for managing Azure resources. 它可讓您彈性地選擇最適合您工作方式的殼層體驗 (Bash 或 PowerShell)。It provides the flexibility of choosing the shell experience that best suits the way you work, either Bash or PowerShell.

您可以透過下列三種方式存取 Cloud Shell:You can access the Cloud Shell in three ways:

  • 直接連結:開啟瀏覽器 link: Open a browser to

  • Azure 入口網站:選取 Azure 入口網站上的 Cloud Shell 圖示:Azure portal: Select the Cloud Shell icon on the Azure portal:

    從 Azure 入口網站啟動 Cloud Shell 的圖示

  • 程式碼片段:在 [ ] 和 [ Microsoft Learn] 上,選取出現 Azure CLI 和 Azure PowerShell 程式碼片段的 [ 試試看 ] 按鈕:Code snippets: On and Microsoft Learn, select the Try It button that appears with Azure CLI and Azure PowerShell code snippets:

    az account show

    [ 試試看 ] 按鈕會在檔中使用 Bash ((適用于 Azure CLI 程式碼片段) 或 PowerShell (Azure PowerShell 程式碼片段) )直接開啟 Cloud Shell。The Try It button opens the Cloud Shell directly alongside the documentation using Bash (for Azure CLI snippets) or PowerShell (for Azure PowerShell snippets).

    若要執行命令,請使用程式碼片段中的 [複製]、使用Ctrl + shift + v (Windows/Linux) 或Cmd + shift + v (macOS) 貼上命令,然後按enter鍵。To run the command, use Copy in the code snippet, use Ctrl+Shift+V (Windows/Linux) or Cmd+Shift+V (macOS) to paste the command, and then press Enter.


以瀏覽器為基礎的體驗Browser-based shell experience

Cloud Shell 以 Azure 管理工作為考量,提供以瀏覽器存取命令列的體驗。Cloud Shell enables access to a browser-based command-line experience built with Azure management tasks in mind. 使用 Cloud Shell 可以只有雲端才能提供的方式離開本機電腦工作。Leverage Cloud Shell to work untethered from a local machine in a way only the cloud can provide.

選擇慣用的殼層體驗Choice of preferred shell experience

使用者可以在 Bash 或 PowerShell 之間進行選擇。Users can choose between Bash or PowerShell.

  1. 選取 Cloud ShellSelect Cloud Shell.

    Cloud Shell 圖示

  2. 選取 BashPowerShellSelect Bash or PowerShell.

    選擇 Bash 或 PowerShell

    第一次啟動之後,您可以使用 [shell 型別] 下拉式控制項,在 Bash 與 PowerShell 之間切換:After first launch, you can use the shell type drop-down control to switch between Bash and PowerShell:

    選取 Bash 或 PowerShell 的下拉式控制項

驗證及設定 Azure 工作站Authenticated and configured Azure workstation

Cloud Shell 由 Microsoft 管理,因此隨附受歡迎的命令列工具和語言支援。Cloud Shell is managed by Microsoft so it comes with popular command-line tools and language support. Cloud Shell 也可安全地自動驗證,讓您可透過 Azure CLI 或 Azure PowerShell Cmdlet 快速存取您的資源。Cloud Shell also securely authenticates automatically for instant access to your resources through the Azure CLI or Azure PowerShell cmdlets.

檢視安裝在 Cloud Shell 中的完整工具清單View the full list of tools installed in Cloud Shell.

整合式 Cloud Shell 編輯器Integrated Cloud Shell editor

Cloud Shell 提供一種以開放原始碼 Monaco Editor 為基礎的整合式圖形化文字編輯器。Cloud Shell offers an integrated graphical text editor based on the open-source Monaco Editor. 只需執行 code . 來透過 Azure CLI 或 Azure PowerShell 順暢地部署,即可建立和編輯設定。Simply create and edit configuration files by running code . for seamless deployment through Azure CLI or Azure PowerShell.

深入了解 Cloud Shell 編輯器Learn more about the Cloud Shell editor.

多個存取點Multiple access points

您可以從下列位置使用 Cloud Shell 這個彈性的工具:Cloud Shell is a flexible tool that can be used from:

連線 Microsoft Azure 檔案儲存體Connect your Microsoft Azure Files storage

Cloud Shell 的機器是暫時性的,但您的檔案會以兩種方式保存:透過磁片映射,以及透過名為的已掛接檔案共用 clouddriveCloud Shell machines are temporary, but your files are persisted in two ways: through a disk image, and through a mounted file share named clouddrive. 第一次啟動時,Cloud Shell 會提示要代替您建立資源群組、儲存體帳戶及 Azure 檔案共用。On first launch, Cloud Shell prompts to create a resource group, storage account, and Azure Files share on your behalf. 這是一次性的步驟,而且會針對所有工作階段自動連接。This is a one-time step and will be automatically attached for all sessions. 單一檔案共用可以進行對應,並同時供 Cloud Shell 中的 Bash 和 PowerShell 使用。A single file share can be mapped and will be used by both Bash and PowerShell in Cloud Shell.

深入瞭解以瞭解如何掛接新的 或現有的儲存體帳戶 ,或瞭解 Cloud Shell 中使用的持續性機制Read more to learn how to mount a new or existing storage account or to learn about the persistence mechanisms used in Cloud Shell.


Cloud shell 儲存體帳戶不支援 Azure 儲存體防火牆。Azure storage firewall is not supported for cloud shell storage accounts.


  • Cloud Shell 會在以每一工作階段、每位使用者為基礎所提供的暫存主機上執行Cloud Shell runs on a temporary host provided on a per-session, per-user basis
  • Cloud Shell 會在無互動活動的 20 分鐘後逾時Cloud Shell times out after 20 minutes without interactive activity
  • Cloud Shell 需要掛接 Azure 檔案共用Cloud Shell requires an Azure file share to be mounted
  • Cloud Shell 會將相同的 Azure 檔案共用同時用於 Bash 和 PowerShellCloud Shell uses the same Azure file share for both Bash and PowerShell
  • Cloud Shell 會以一台機器、一個使用者帳戶的方式指派Cloud Shell is assigned one machine per user account
  • Cloud Shell 會使用檔案共用中所保有的 5 GB 映像來保存 $HOMECloud Shell persists $HOME using a 5-GB image held in your file share
  • 權限設定為一般 Linux 使用者 (採用 Bash)Permissions are set as a regular Linux user in Bash

深入了解 Cloud Shell 中的 BashCloud Shell 中的 PowerShell 中的功能。Learn more about features in Bash in Cloud Shell and PowerShell in Cloud Shell.


裝載 Cloud Shell 的機器是免費提供的,但前提是必須掛接「Azure 檔案」共用。The machine hosting Cloud Shell is free, with a pre-requisite of a mounted Azure Files share. 所需成本和一般儲存體相同。Regular storage costs apply.

後續步驟Next steps

Cloud Shell 中 Bash 的快速入門Bash in Cloud Shell quickstart
Cloud Shell 中 PowerShell 的快速入門PowerShell in Cloud Shell quickstart