The Azure Cloud Shell Empowers You to run Scripts in Your Browser
January 09, 2018 10:43 Comments [0]Azure provides several ways of managing resources through scripting users. You can write scripts in either PowerShell (a popular Windows tool for managing servers and IAT resources) or CLI (a Bash-like scripting language that runs on Windows, Linux, and MacOS).
To use these tools, you need to have them installed locally, along with any support tools, such as the Azure PowerShell commandlets.
Until now.
Recently, Microsoft released the Azure Cloud Shell - a browser-based command-line interface built into the Azure portal. By opening a Cloud Shell from the Azure Portal, you can execute PowerShell or CLI scripts from within your browser, without installing anything.
To open Cloud Shell, navigate to the Azure portal and click the [Cloud Shell] button (Fig. 1) on the top tool bar.
It may take a minute to retrieve and connect to a Cloud Shell environment (Fig. 2), but soon you will see a window with a command prompt, as Shown in Fig. 3.
The Cloud Shell in the image is configured to run CLI scripts. You can tell this by the dropdown in the window's top left corner. You can also run PowerShell scripts in a Cloud Shell window. To change the script types, click the top left dropdown and select your desired scripting language, as shown in Fig. 4.
Fig. 5 shows the Cloud Shell with PowerShell selected.
You don't need to log into the Cloud Shell environment. It will assume the account from which it was launched.
But you can view, create, and manage Azure resources. For example, from the Bash shell, type
az group list -o table
To see a list of all Resource Groups
or
az group create -l southeastus -n myrg
to create a new resource group named "myrg" in the Southeast US region.
You can even do other bash commands, such as ssh into an Azure Linux VM.
Cloud Shell automatically creates a container within an Azure VM to host your session. Although this container is destroyed shortly after you disconnect, Cloud Shell also creates a storage account to persist files or settings you use when using this interface, so they will be there when you return.
Azure Cloud Shell provides an environment for you to execute automation scripts and other administrative functions.