Azure – Introduction to Azure Cloud Shell – support to various tools including Python

Azure Cloud Shell - Support to Python
Azure Cloud Shell - Support to Python

Hi All,

LIFE IS BEAUTIFUL πŸ™‚ I hope we all are safe πŸ™‚ STAY SAFE, STAY HEALTHY,Β STAY HOME πŸ™‚

Today, in this article we will discuss most powerful Azure resource management toolAzure Cloud Shell. Very important to know each IT person who works on Azure πŸ™‚

Take away from this article :

  • Understand what is – Azure Cloud Shell ?
  • How to start Azure Cloud Shell and execute the commands
  • Various tools supported by Azure Cloud Shell

What is Azure Cloud Shell?

  • Azure cloud shell enables us to manage Azure resources, execute the scripts directly from the browser
  • Azure cloud shell allows us to use both following prompts in browser
    • Bash
    • PowerShell
  • Azure Cloud Shell offers a browser-accessible, pre-configured shell experience for managing Azure resources without the overhead of installing, versioning, and maintaining a machine yourself.

Opening Azure Cloud Shell in Azure Portal:

  • Login to Azure Portal
  • We have icon “Cloud Shell” at top right corner as shown in below Fig
Microsoft Azure - Azure Portal - Azure Cloud Shell Icon
Fig : Microsoft Azure – Azure Portal – Azure Cloud Shell Icon
  • Once we clicked on “Azure Cloud Shell” icon, we will have an option to select the prompt either “Bash” OR “PowerShell” as shown in below Fig
Microsoft Azure - Azure Portal - Azure Cloud Shell - Prompt for selecting shell either "Bash" OR "PowerShell"
Fig : Microsoft Azure – Azure Portal – Azure Cloud Shell – Prompt for selecting shell either “Bash” OR “PowerShell”
  • Azure Cloud Shell requires Azure Subscription. If we don’t have Azure Subscription we will get following message as
Microsoft Azure - Azure Portal - Azure Cloud Shell - "No valid subscriptions found" message
Fig : Microsoft Azure – Azure Portal – Azure Cloud Shell – “No valid subscriptions found” message
  • Once we logged in with our subscription account, next step will be storage (Azure file share) required to store the files
  • If we don’t have storage mounted then we will get an message “You have no storage mounted” as shown in below Fig
Microsoft Azure - Azure Portal - Azure Cloud Shell - "You have no storage mounted" message - Azure Cloud Shell requires Storage to persist file
Fig : Microsoft Azure – Azure Portal – Azure Cloud Shell – “You have no storage mounted” message – Azure Cloud Shell requires Storage to persist file
  • We will have “Create storage” option available as shown in above Fig
  • Creating a storage requires cost, make sure we went through the pricing details before creating any storage
  • Actual require cost is very minimal πŸ™‚
  • Once we are ready with Storage, Azure Cloud Shell gets ready as shown in below Fig
Microsoft Azure - Azure Portal - Azure Cloud Shell - Azure Cloud Shell getting ready
Fig : Microsoft Azure – Azure Portal – Azure Cloud Shell – Azure Cloud Shell getting ready
  • In Azure Cloud Shell, in place of PowerShell if we need to use Azure CLI then just type “az” and we could then user Azure CLI in place of PowerShell

Opening Azure Cloud Shell Standalone :

Microsoft Azure - Azure Portal - Azure Cloud Shell - opening directly in browser using - http://shell.azure.com
Fig : Microsoft Azure – Azure Portal – Azure Cloud Shell – opening directly in browser using – http://shell.azure.com

More Details :

  • Session time out for Azure Cloud Shell is 20 Minutes. If we are inactive for 20 Minutes in Azure Cloud Shell, session get expired, we need to connect again
  • As we discussed above, Azure Cloud Shell requires an Azure file share to be mounted
  • Azure Cloud Shell securely and automatically authenticates account access for the Azure CLI and Azure PowerShell.
  • Azure Cloud Shell comes with lots of inbuilt tools including
    • Linux Tools => bash, zsh, sh, tmux, dig
    • Text editors => code (Cloud Shell editor), vim, nano, emacs
    • Source Control => git
    • Build Tools => make, maven, npm, pip
    • Containers => Docker Machine, Kubectl, Helm, DC/OS CLI
    • Databases => MySQL client, PostgreSql client, sqlcmd Utility, mssql-scripter
    • Others => iPython Client, Cloud Foundry CLI, Terraform, Ansible, Chef InSpec, Puppet, Bolt, HashiCorp Packer, Office 365 CLI

Support to Python :

  • The Azure Cloud shell includes several inbuilt tools to use among these tools includes my most favorite Python.
  • We need to simply use the command python executable
  • Then we could start executing Python scripts directly within the Azure Cloud Shell.
  • Anyway we always install and use Python locally, but the Azure Cloud Shell offers an environment that can be used from any where regardless of local installation of tooling.
  • I’ll cover more in depth on this in next upcoming articles πŸ™‚
Microsoft Azure - Azure Portal - Azure Cloud Shell - Python inbuilt tool
Fig : Microsoft Azure – Azure Portal – Azure Cloud Shell – Python inbuilt tool

References:

Thanks for readingΒ πŸ™‚ Feel free to discuss / comments / questions πŸ™‚ SHARING IS CARING πŸ™‚

Share In Teams:

Enjoy the beautiful life πŸ™‚ Have a FUN πŸ™‚ HAVE A SAFE LIFE πŸ™‚ TAKE CARE πŸ™‚

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

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

%d bloggers like this: