Features & tools for PowerShell in Azure Cloud Shell (Preview)

Azure Cloud Shell is a browser-based shell experience to manage and develop Azure resources.

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 provisions machines on a per-request basis and as a result machine state will not persist across sessions. Since Cloud Shell is built for interactive sessions, shells automatically terminate after 20 minutes of shell inactivity.

Tip

Features & tools for Bash is also available.

PowerShell in Cloud Shell (Preview) runs on Windows Server 2016.

Features

Secure automatic authentication

PowerShell in Cloud Shell (Preview) securely and automatically authenticates account access for the Azure PowerShell.

Files persistence across sessions

To persist files across sessions, Cloud Shell walks you through attaching a Microsoft Azure Files share on first launch. Once completed, Cloud Shell will automatically attach your storage (mounted as $home\clouddrive) for all future sessions. Since each request for Cloud Shell is allocating a temporary machine, files outside of your $home\clouddrive and machine state are not persisted across sessions.

Learn more about attaching Azure file shares to Cloud Shell.

Azure drive (Azure:)

PowerShell in Cloud Shell (Preview) starts you in Azure drive (Azure:). Azure drive enables easy discovery and navigation of Azure resources such as Compute, Network, Storage etc. similar to filesystem navigation. You can continue to use the familiar Azure PowerShell cmdlets to manage these resources. Any changes made to the Azure resources, either made directly in Azure portal or through Azure PowerShell cmdlets, are instantly reflected in the Azure drive.

Contextual awareness

  • Resource group scoping: When within the context of a resource group path in the Azure drive (Azure:), the resource group name is automatically passed to the Azure PowerShell cmdlets.

  • Get-AzureRmCommand: This cmdlet returns the list of commands applicable in the context of the location under Azure drive (Azure:). For example, it shows only storage-related commands when user is under Azure:\<subscription name>\StorageAccounts

Rich PowerShell script editing

When you use VIM to edit PowerShell files (.ps1,.psm1,.psd1), you automatically get syntax highlighting and IntelliSense support. IntelliSense support is implemented via a vim-plugin that interacts with a local instance of PowerShell Editor Services.

Tip

Use TAB to get completion (IntelliSense) on command names, parameter names, and parameter values (where applicable).

Extensible model

Using PowerShellGet, you can easily install (and update) custom modules and scripts from the PowerShell Gallery. After installation, your modules are automatically persisted across Cloud Shell sessions.

Tip

Modules installed by users are saved in the $Home\CloudDrive\.pscloudshell\WindowsPowerShell folder. A symbolic link for this folder is created in the user's documents folder ($home\Documents\WindowsPowerShell).

Management of Guest VMs

Using two built-in commands - Enter-AzureRmVM and Invoke-AzureRmVMCommand, you can remotely manage your Azure VMs. These commands are built on top of PowerShell remoting and require PowerShell connectivity to the Azure VMs.

Tools

Category Name
Azure tools Azure PowerShell (5.0.1)
Azure CLI (2.0.22)
Text editors vim
nano
Package Manager PowerShellGet
PackageManagement
npm
pip
Source control git
Databases SqlServer module
sqlcmd Utility
Test tools Pester

Language support

Language Version
.NET 4.6
Node.js 6.10
PowerShell 5.1 and 6.0 (beta)
Python 2.7

Next steps

Quickstart with PowerShell in Cloud Shell (Preview)

Learn about Azure PowerShell