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

Azure Cloud Shell 的功能和工具Features & tools for Azure Cloud Shell

Azure Cloud Shell 是一种基于浏览器的 shell 体验,用于管理和开发 Azure 资源。Azure Cloud Shell is a browser-based shell experience to manage and develop Azure resources.

Cloud Shell 提供可通过浏览器访问的预配置 shell 体验,用于管理 Azure 资源,而无需花费自己安装计算机、对其进行版本控制和维护的开销。Cloud Shell offers a browser-accessible, pre-configured shell experience for managing Azure resources without the overhead of installing, versioning, and maintaining a machine yourself.

Cloud Shell 按请求预配计算机,因此计算机状态不会在会话之间保留。Cloud Shell provisions machines on a per-request basis and as a result machine state will not persist across sessions. 由于 Cloud Shell 专为交互式会话构建,因此 shell 在处于非活动状态 20 分钟后会自动终止。Since Cloud Shell is built for interactive sessions, shells automatically terminate after 20 minutes of shell inactivity.

Azure Cloud Shell 在 Ubuntu 16.04 LTS 上运行。Azure Cloud Shell runs on Ubuntu 16.04 LTS.

功能Features

安全自动身份验证Secure automatic authentication

Cloud Shell 安全、自动地验证帐户对 Azure CLI 和 Azure PowerShell 的访问权限。Cloud Shell securely and automatically authenticates account access for the Azure CLI and Azure PowerShell.

$HOME 可在会话之间持久保存$HOME persistence across sessions

要在会话之间保存文件,Cloud Shell 会指导完成在首次启动时附加 Azure 文件共享。To persist files across sessions, Cloud Shell walks you through attaching an Azure file share on first launch. 完成后,Cloud Shell 会自动为所有将来的会话附加存储(装载为 $HOME\clouddrive)。Once completed, Cloud Shell will automatically attach your storage (mounted as $HOME\clouddrive) for all future sessions. 此外,$HOME 目录以 .img 格式持久保存在 Azure 文件共享中。Additionally, your $HOME directory is persisted as an .img in your Azure File share. $HOME 外部的文件和计算机状态不会持久保存在不同的会话中。Files outside of $HOME and machine state are not persisted across sessions. 存储机密(如 SSH 密钥)时,请使用最佳做法。Use best practices when storing secrets such as SSH keys. 像 Azure Key Vault 这样的服务有设置教程Services like Azure Key Vault have tutorials for setup.

详细了解如何在 Cloud Shell 中持久保存文件。Learn more about persisting files in Cloud Shell.

Azure 驱动器 (Azure:)Azure drive (Azure:)

Cloud Shell 中的 PowerShell 在启动时会打开 Azure 驱动器 (Azure:)。PowerShell in Cloud Shell starts you in Azure drive (Azure:). 使用 Azure 驱动器可以轻松发现和浏览 Azure 资源(例如计算、网络、存储等),类似于文件系统导航。The Azure drive enables easy discovery and navigation of Azure resources such as Compute, Network, Storage etc. similar to filesystem navigation. 无论位于何种驱动器,都可以继续使用熟悉的 Azure PowerShell cmdlet 来管理这些资源。You can continue to use the familiar Azure PowerShell cmdlets to manage these resources regardless of the drive you are in. 直接在 Azure 门户中或者通过 Azure PowerShell cmdlet 对 Azure 资源所做的任何更改会反映在 Azure 驱动器中。Any changes made to the Azure resources, either made directly in Azure portal or through Azure PowerShell cmdlets, are reflected in the Azure drive. 可以运行 dir -Force 刷新资源。You can run dir -Force to refresh your resources.

管理 Exchange OnlineManage Exchange Online

Cloud Shell 中的 PowerShell 包含 Exchange Online 模块的专用生成。PowerShell in Cloud Shell contains a private build of the Exchange Online module. 运行Connect-EXOPSSession以获取 Exchange cmdlet。Run Connect-EXOPSSession to get your Exchange cmdlets.

运行 Get-Command -Module tmp_*Run Get-Command -Module tmp_*

备注

模块名称应以开头tmp_, 如果已使用相同的前缀安装了模块, 则还会显示其 cmdlet。The module name should begin with tmp_, if you have installed modules with the same prefix, their cmdlets will also be surfaced.

与开源工具深度集成Deep integration with open-source tooling

Cloud Shell 预先配置了开放源代码工具(如 Terraform、Ansible 和 Chef InSpec)的身份验证。Cloud Shell includes pre-configured authentication for open-source tools such as Terraform, Ansible, and Chef InSpec. 请通过示例演练试用该功能。Try it out from the example walkthroughs.

工具Tools

类别Category 名称Name
Linux 工具Linux tools bashbash
zshzsh
shsh
tmuxtmux
digdig
Azure 工具Azure tools Azure CLIAzure 经典 CLIAzure CLI and Azure classic CLI
AzCopyAzCopy
Azure Functions CLIAzure Functions CLI
Service Fabric CLIService Fabric CLI
批处理 ShipyardBatch Shipyard
blobxferblobxfer
文本编辑器Text editors 代码(Cloud Shell 编辑器)code (Cloud Shell editor)
vimvim
nanonano
emacsemacs
源代码管理Source control gitgit
生成工具Build tools makemake
mavenmaven
npmnpm
pippip
容器Containers Docker 计算机Docker Machine
KubectlKubectl
HelmHelm
DC/OS CLIDC/OS CLI
数据库Databases MySQL 客户端MySQL client
PostgreSql 客户端PostgreSql client
sqlcmd 实用工具sqlcmd Utility
mssql-scriptermssql-scripter
其他Other iPython 客户端iPython Client
Cloud Foundry CLICloud Foundry CLI
TerraformTerraform
AnsibleAnsible
Chef InSpecChef InSpec
Puppet 螺栓Puppet Bolt
HashiCorp PackerHashiCorp Packer

语言支持Language support

语言Language VersionVersion
.NET Core.NET Core 2.0.02.0.0
转到Go 1.91.9
JavaJava 1.81.8
Node.jsNode.js 8.9.48.9.4
PowerShellPowerShell 6.2.06.2.0
PythonPython 2.7 和 3.5(默认)2.7 and 3.5 (default)

后续步骤Next steps

Cloud Shell 中的 Bash 快速入门Bash in Cloud Shell Quickstart
Cloud Shell 中的 PowerShell 快速入门PowerShell in Cloud Shell Quickstart
了解 Azure CLILearn about Azure CLI
了解 Azure PowerShellLearn about Azure PowerShell