Azure Cloud Shell


In a prior post I went over getting started with Azure automation using Azure Automation Account. Another way to run PowerShell scripts against an Azure subscription is to use Azure Cloud Shell. I think of Azure Automation Account as PaaS PowerShell whereas Azure Cloud Shell is more like IaaS PowerShell (more like PowerShell web access running on an Azure container).

Access

Azure Cloud Shell can be access from https://shell.azure.com/ or by clicking the Cloud Shell icon in the Azure Portal

Features

We have most of the common PowerShell features such as tab completion. Initially Get-Module shows:

Copy/paste works, although keyboard shortcuts like CTRL-C and CTRL-V do not.

Unlike Azure Automation Account, we can install and import PS modules directly from the shell:

We get drive y: as an Azure file share for persistent storage, since these PS sessions are not..

We have access to more than PowerShell in this shell, such as Azure CLI and Python, which I choose to completely ignore in this post, and focus on PowerShell only 🙂

The Azure: drive provides access to the available subscriptions and their objects:

So, we can list VMs under a given subscription by simply iterating the objects under azure:\subscription_name\VirtualMachines !!

You can tell that the Azure: drive provider is using the required AzureRM cmadlets to fetch the requested objects. In this example, it’s calling Get-AzureRmVM cmdlet

We can upload files to the y: drive Azure file share directly from the Azure portal:

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.