您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

Azure Cloud Shell 的概述Overview of Azure Cloud Shell

Azure Cloud Shell 是一个用于管理 Azure 资源的交互式的可通过浏览器访问的 shell。Azure Cloud Shell is an interactive, browser-accessible shell for managing Azure resources. 它使用户能够灵活选择最适合自己工作方式的 shell 体验。It provides the flexibility of choosing the shell experience that best suits the way you work. Linux 用户可以选择 Bash 体验,Windows 用户可以选择 PowerShell。Linux users can opt for a Bash experience, while Windows users can opt for PowerShell.

单击以下图标,前往 shell.azure.com 试用。Try from shell.azure.com by clicking below.

尝试从 Azure 门户使用 Cloud Shell 图标。Try from Azure portal using the Cloud Shell icon.

门户启动

功能Features

基于浏览器的 shell 体验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.

选择偏好的 shell 体验Choice of preferred shell experience

Linux 用户可以使用 Bash in Cloud Shell,而 Windows 用户可以使用 shell 下拉列表中的“PowerShell in Cloud Shell (预览版)”。Linux users can use Bash in Cloud Shell, while Windows users can use PowerShell in Cloud Shell (Preview) from the shell dropdown.

Cloud Shell 中的 Bash

PowerShell in Cloud Shell(预览版)

经身份验证的已配置 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 2.0 或 Azure PowerShell cmdlet 访问资源。Cloud Shell also securely authenticates automatically for instant access to your resources through the Azure CLI 2.0 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 2.0 或 Azure PowerShell 进行无缝部署。Simply create and edit configuration files by running code . for seamless deployment through Azure CLI 2.0 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 计算机是临时的,因此需要装载 Azure 文件共享作为 clouddrive 来持久保存文件。Cloud Shell machines are temporary and require an Azure Files share to be mounted as clouddrive to persist your files.

首次启动时,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. 单个文件共享可以映射,将 Bash 和 PowerShell in Cloud Shell(预览版)使用。A single file share can be mapped and will be used by both Bash and PowerShell in Cloud Shell (Preview).

创建新存储Create new storage

系统可代你创建本地冗余存储 (LRS) 帐户和 Azure 文件共享。A locally-redundant storage (LRS) account and Azure Files share can be created on your behalf. 如果选择同时使用 Bash 和 PowerShell 环境,Azure 文件共享将用于这两种环境。The Azure Files share will be used for both Bash and PowerShell environments if you choose to use both. 将收取常规存储费用。Regular storage costs apply.

将替你创建以下三个资源:Three resources will be created on your behalf:

  1. 资源组:cloud-shell-storage-<region>Resource Group named: cloud-shell-storage-<region>
  2. 存储帐户:cs<uniqueGuid>Storage Account named: cs<uniqueGuid>
  3. 文件共享:cs-<user>-<domain>-com-<uniqueGuid>File Share named: cs-<user>-<domain>-com-<uniqueGuid>

备注

Cloud Shell 中的 Bash 还会创建一个默认的 5-GB 磁盘映像用于持久保存 $HomeBash in Cloud Shell also creates a default 5-GB disk image to persist $Home. $Home 目录中的所有文件(如 SSH 密钥)将持久保存在已装载的 Azure 文件共享中存储的用户磁盘映像中。All files in your $Home directory such as SSH keys are persisted in your user disk image stored in your mounted Azure file share. 在 $Home 目录和已装载的 Azure 文件共享中保存文件时,请应用最佳做法。Apply best practices when saving files in your $Home directory and mounted Azure file share.

使用现有资源Use existing resources

提供了一个高级选项用于将现有资源关联到 Cloud Shell。An advanced option is provided to associate existing resources to Cloud Shell. 在存储设置提示下,单击“显示高级设置”显示其他选项。At the storage setup prompt, click "Show advanced settings" to show additional options.

备注

从下拉列表筛选预先分配的 Cloud Shell 区域和 LRS/GRS/ZRS 存储帐户。Dropdowns are filtered for your pre-assigned Cloud Shell region and LRS/GRS/ZRS storage accounts.

了解 Cloud Shell 存储、更新 Azure 文件共享和上传/下载文件。Learn about Cloud Shell storage, updating Azure file shares, and uploading/downloading files.

概念Concepts

  • 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 对 Bash 和 PowerShell 使用相同的 Azure 文件共享Cloud 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
  • 在 Bash 中权限是按常规 Linux 用户设置的Permissions are set as a regular Linux user in Bash

详细了解 Bash in Cloud ShellPowerShell in Cloud Shell(预览版)的功能。Learn more about features in Bash in Cloud Shell and PowerShell in Cloud Shell (Preview).

定价Pricing

托管 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

Bash in Cloud Shell 快速入门Bash in Cloud Shell quickstart
PowerShell in Cloud Shell(预览版)快速入门PowerShell in Cloud Shell (Preview) quickstart