What is Azure Cloud Shell and How to use it?

Srinivasan Baskaran
Cloudnloud Tech Community
5 min readMar 20, 2023

Let’s start exploring what is Azure Cloud shell and how we can use it for managing the Azure services and resources.

The Azure Command-Line Interface (CLI) and Azure Cloud Shell are powerful, cross-platform tools that provide an interactive, authenticated, and browser-accessible command-line interface. These tools can be installed on local machines and are supported on Windows, Linux, and Mac OS. The installation process may vary depending on the platform, but once installed, the command interface remains consistent across all platforms. For installing locally, please refer the documentation here.

The current version of the Azure CLI is 2.46.0. For information about the latest release, you can refer here for release notes.

Azure Cloud Shell is readily available in azure portal GUI to write the scripting for handling and maintaining the azure resources. We have already direct access in the portal for implementing, but that way is ok for one go set up.

By utilizing Azure Cloud Shell, you can write scripts that automate the process of implementing and maintaining resources. This not only saves time and effort but also ensures accuracy and consistency in the process. With Azure Cloud Shell, you can easily manage your resources and make changes as needed, all from a single platform.

Azure Cloud shell comes with two options, namely the user can either opt for PowerShell scripting or Bash Shell scripting.

Azure platform provides the usage of Cloud shell is free mode but requires storage account in order to work with which will have a standard cost, so here is the behind scene to understand the cost associated for the user.

For those who are already worked in UNIX or LINUX system, handling the Azure Cloud Shell will be just a different environment to work with that's it and rest of them just need to explore the options available in ease to work with azure platform.

To use Azure Cloud shell, you need to have active Azure Account and the Azure Subscription.

Assume we have got the azure account and subscription and wants to launch the cloud shell, here is the URL (https://portal.azure.com/)you need to traverse and login to the account as shown below

You should see an icon with prompt, next to the search bar in top right side of the azure portal as pointed above, this is for launch to Cloud shell. On hitting that icon, it will prompt for the creation of storage account along with option to choose the active subscription here, this is needed for very first-time access with no storage account associated for the cloud shell.

On selecting the active subscription from the list and opting to Create storage from above prompt page this will take to default shell/terminal editor as shown below with success message and prompt for the default type

In the script/terminal editor page, top left corner you can see the option for selecting the scripting either to PowerShell or Bash by selecting the arrow of that list, now let we opt for the bash as shown below

Just select option Confirm to acknowledge the change of script.

Cloud shell uses the file storage for file persistent across the sessions. We can change the existing file storage from the Advanced Settings while selecting the subscription as shown above in one of the references.

Now you are in Bash shell with the prompt waiting for your commands to process.

Since you are already in the portal and accessing this, you are not required to login or authenticate yourself separately, since this was already part of launching it.

Let's execute a first shell command to check the version of the CLI and other dependencies available!

az --version

Now we can see the version summary. Let say i want to work with azure service namely resource group and want to see what all possibility are, then we execute this following command, “ — -help” will get you details of the resource subgroup option.

az resource --help

— help is the knowledge base which is useful to start with and to get first information on the command that we are interested to execute in shell prompt. find is another option available as AI robot knowledge base for getting samples or more details on the shell command.

Note: You can directly access this URL to open the shell or terminal editor with the URL https://portal.azure.com/#cloudshell/

Source: Azure Documentation and images from google

That’s it, thank you for reading.

Happy to share this article to help you to explore new updates, do follow me and my community, click the clap 👏 button below to show your valuable support.

--

--

Srinivasan Baskaran
Cloudnloud Tech Community

Qualified IT professional with over 20+ years of experience in rendering Technical Expertise in Microsoft, Cloud (Azure, AWS) .Net/SQL Development, DevOps, RDBM