Skip to content

Azure Cloud Shell

What Where
Official Page
Cloud Shell Tools

Further Links

Cloud Shell options

There are three options to use the cloud shell: Docker, Windows Terminal and the Azure Web Interface:


You get a CloudShell container as follows:

docker run -it /bin/bash # for bash
docker run -it /usr/bin/pwsh # for powershell

Windows Terminal

The Windows terminal has the cloud shell integrated. Aside from other features this is a good way to interact with azure on command line.

Install the windows terminal withchoco install microsoft-windows-terminal. You need to login to azure first to use the terminal.

Azure Portal

Go to and you are logged in with your current user.

To get a GUI editor in the web runcode ..

Attach Storage

  • Add FileShare to Cloud Shell: clouddrive mount -s <secret> -g <rg-name> -n <fileshare> -f <share>
  • Show Drives: Get-CloudDrive
  • Remove or re-configure your cloud drive: dismount-clouddrive


Connect to VM console

You can access an Azure VM within the Azure Cloud Shell.

Enable remoting if not yet done:

Enable-AzVMPSRemoting -Name MyVM1 -ResourceGroupname MyResourceGroup

Execute script on VM:

Invoke-AzVMCommand -Name MyVM1 -ResourceGroupName MyResourceGroup -Scriptblock {Get-ComputerInfo} -Credential (Get-Credential)

Enter VMs commandline:

Enter-AzVM -Name MyVM1 -ResourceGroupName MyResourceGroup -Credential (Get-Credential)

Enhance CloudShell Bash

Posh-Git provides us with information at the command line about the state of the current repository we are in. It also provides tab completion for Git commands.

install-module posh-git
import-module posh-git

Oh-My-Posh allows you to theme your prompt with various color schemes, Git status indicators, Admin status and many other things.

Install-Module oh-my-posh
Import-module oh-my-posh

Get-ChildItemColor is a simple tool which adds color coding to the get-childitem command. When you run this command, you get different colors used for folders vs. files and different file types.

Install-Module Get-ChildItemColor
Import-Module Get-ChildItemColor