Or indeed an Android phone, an iphone or your tablet of choice. Of course, you could use a laptop but that means getting off the sofa.
This is a quick introduction to Azure Cloud Shell. So how do you manage your Azure resources today? Chances are that the portal plays a large part of your day to day work but I suspect that you also rely on scripts and other development environments such as Visual Studio. I certainly do. I’ve got my laptop configured with Visual Studio, the Azure SDK and other dependencies but wouldn’t it be neat to have a cloud based shell that is always up to date with the latest SDKs and a browser based experience for using bash and PowerShell within the portal. And then you could fire up from any modern browser? Let’s take a look.
Within the Azure portal, you might not have noticed a new icon. The >_ that is highlighted in red below.
The first time you click on the icon you will be presented with a polite welcome message, asking you which Shell (Bash or PowerShell) you would like. Don’t worry, you can easily switch between Bash and PowerShell later so I’m going to choose the PowerShell route.
Configure Cloud Shell
And then you will be asked to provision the required resources to support Cloud Shell. We’ll choose “Show Advanced Settings”.
But first, it is perhaps worthwhile stepping back and considering in more detail how Cloud Shell works. The official Microsoft documentation is here.
When you launch Cloud Shell, a container is provisioned which comes pre-installed with popular command-line tools and language support so you can work faster. The container, running in Azure, mounts your storage and renders the output in the browser. Because these are containers and the environment is temporary, an Azure file share mounted to persist your home directory. The tools installed on the Cloud Shell container are explained in the following links:
Now lets head back to the Advanced Settings where we can specify the names of the Azure resources we want to create to support Azure Cloud Shell.
Create resources to support Azure Cloud Shell
Enter in the details for the Resource Group, Storage Account and File Share that you want to create and then click Create Storage. That’s it.
Now you have your fully functional Shell in the Cloud.
Let’s try it out on creating an OMS workspace from an ARM Template stored in GitHub:
1. We need to create the resource group:
New-AzureRmResourceGroup -Name TestRG1 -Location "West Europe"
2.Create the workspace
New-AzureRmResourceGroupDeployment -Name ExampleLogAnalyticsWorkspace -ResourceGroupName TestRG1 -Templateuri https://raw.githubusercontent.com/f1point2/ARMTemplateExample/master/OMSWorkspaceResource.json
And there you have it. We have an OMS (Log Analytics) workspace created using PowerShell (CloudShell) from an iPad.