Azure Cloud Shell Overview and Features

Author

Reads 811

Computer server in data center room
Credit: pexels.com, Computer server in data center room

Azure Cloud Shell is a browser-based shell experience that allows you to use the command line in the cloud. It's a free service that lets you run Bash or PowerShell commands from the Azure portal.

Azure Cloud Shell is available in the Azure portal, and you can access it from any browser. You can also pin it to your Azure dashboard for easy access.

Azure Cloud Shell comes with a set of pre-installed tools, including Azure CLI, Azure PowerShell, and a file system that allows you to store and manage your files. This means you can use it to manage your Azure resources without having to install anything on your local machine.

What is Azure Cloud Shell?

Azure Cloud Shell is a browser-accessible shell for managing Azure resources in Bash or PowerShell. It's essentially a command-line interface that lets you run commands and scripts against your Azure resources with ease.

Azure Cloud Shell runs in a container or a lightweight image containing application software that can run on top of an operating system. This means you can access your Azure resources from anywhere, without having to install any software on your local machine.

Credit: youtube.com, AZ-900 Episode 19 | Azure Tools | Azure Portal, CLI, PowerShell & Cloud Shell

You can use Azure Cloud Shell to manage your Azure subscription, including creating, listing, and deleting subscriptions, and managing user access keys. This is made possible by a rich command set that's designed to make tasks easier.

To get started with Azure Cloud Shell, you can access interactive tutorials that cover common features like creating VMs or Virtual Networks. These tutorials are a great way to learn the ropes and get familiar with the interface.

Here are some key features of Azure Cloud Shell:

  • Run commands and scripts against your Azure resources in a single command-line interface that supports tab completion, history, and more.
  • Manage your Azure subscription with a rich command set that lets you create, list, and delete subscriptions and manage user access keys.
  • Get started with interactive tutorials on using the most common features, such as creating VMs or Virtual Networks.

Azure Cloud Shell also has a unique way of storing files over multiple sessions. Since containers are transient, it creates an Azure file share to securely store your data files. This file share is mounted in your Cloud Shell home directory or as a separate drive labeled “clouddrive”.

Accessing Azure Cloud Shell

You can access Azure Cloud Shell by browsing to https://shell.azure.com or by using the Azure Web Portal. This will let you use either the PowerShell or Bash environment.

Credit: youtube.com, How to access and use the Azure Cloud Shell

To open Azure Cloud Shell within the Azure Portal, click the Cloud Shell icon in the header bar. This will open Cloud Shell in a pane at the bottom of the browser.

You can also access Cloud Shell by clicking the Cloud Shell icon at the top right of the Azure Portal. This will give you access to a browser-based command-line experience.

Azure Cloud Shell defaults to PowerShell, but it also supports a Bash prompt. You can switch between the two environments by typing pwsh or bash in the shell.

Here are the options for accessing PowerShell in Azure Cloud Shell:

  1. Type pwsh in the shell, and you'll be authenticated into an instance of Cloud Shell with PowerShell.
  2. Re-launch the Cloud Shell window by choosing PowerShell from the dropdown menu and choosing 'Confirm' to restart.

It's worth noting that the OS for the Cloud Shell instance is Linux, and you can verify the version of PowerShell you are running by typing $PSVersionTable.

Features and Tools

Azure Cloud Shell is a browser-based shell experience that allows you to manage Azure resources without installing or maintaining a virtual machine. It runs on Common Base Linux Delridge.

Credit: youtube.com, Explore the New Azure Cloud Shell UI: Features and Benefits

You can access a wide variety of tools from both PowerShell and Bash, including Linux tools like bash, sh, zsh, tmux, and dig.

Here are some of the tools you can use in Azure Cloud Shell:

  • Linux tools: bash, sh, zsh, tmux, and dig
  • Azure tools: Azure CLI, AzCopy, Azure Functions CLI, blobxfer, Service Fabric CLI, Azure Classic CLI, and Batch Shipyard
  • Text editors: code, nano, vim, and emacs
  • Containers: Docker Machine, kubectl, Helm, and DC/OS CLI
  • Databases: MySQL client, sqlcmd Utility, PostgreSql client, and mssql-scripter

Azure Cloud Shell also supports deep integration with open-source tools, including pre-configured authentication for tools like Ansible, Terraform, and Chef InSpec.

Features and Tools

Azure Cloud Shell is a browser-based shell experience that lets you manage Azure resources without installing or maintaining a virtual machine. It runs on Common Base Linux Delridge.

One of the key benefits of Azure Cloud Shell is its ability to integrate with open-source tools. This includes pre-configured authentication for tools like Ansible, Terraform, and Chef InSpec.

Here are some of the features that enable this integration:

  • Executes on a temporary host based on per user, per session.
  • Session times out after 20 minutes of interactive inactivity.
  • Uses Azure file share for PowerShell and Bash.
  • Assigns one machine per user account.
  • $HOME is persisted using a 5-GB image in your file share.
  • Sets permissions in Bash as a regular Linux user.

Azure Cloud Shell also comes with a range of built-in tools, including Linux tools, Azure tools, text editors, containers, and databases. Some of the specific tools available include bash, sh, zsh, tmux, and dig for Linux tools, and Azure CLI, AzCopy, and Azure Functions CLI for Azure tools.

Credit: youtube.com, Describe features and tools in Azure for governance and compliance | Day 21

Here's a breakdown of the different types of tools available in Azure Cloud Shell:

Some new tools have also been added to Azure Cloud Shell, including Azure Functions CLI, Bolt, and Packer.

Code Snippets

Code snippets can be a huge time-saver in the development process. You can install the Azure Account extension in Visual Studio Code by adding two new commands that can be run from within VS Code.

To get started, you'll need to open Bash in Cloud Shell. This will give you access to a command line interface where you can enter commands and see the results.

The Azure Account extension can also be installed by opening PowerShell in Cloud Shell. This will give you a different set of commands and tools to work with.

Once you've installed the Azure Account extension, you can start using it to manage your Azure resources. This includes creating and managing storage accounts, virtual machines, and more.

To get the most out of the Azure Account extension, be sure to explore the different commands and tools that are available to you. With practice, you'll become more comfortable using the extension and be able to complete tasks more efficiently.

Integrated Editor

Credit: youtube.com, Now Integrating Your Text Editing Features Is Easy with Rich Text Editor

The Integrated Editor is a powerful tool in Cloud Shell. It's based on the Monaco Editor, which allows for seamless creation and editing of configuration files.

You can run code and enable deployment through Azure PowerShell or Azure CLI to take full advantage of the Integrated Editor. This feature is a game-changer for developers who need to work on multiple files at once.

The Integrated Editor is a graphical text editor, making it easy to navigate and understand even for those who are new to coding. With its intuitive interface, you can focus on writing code without getting bogged down in complex editing tools.

Accessing Command Line Tools

You can access a wide variety of command line tools in Cloud Shell, which supports both PowerShell and Bash. This means you can use the tools you're familiar with, without having to learn new ones.

Cloud Shell supports a wide variety of tools that are accessible from both PowerShell and Bash. You can experience some of these tools firsthand.

Credit: youtube.com, Windows Command Line Tools

One way to access PowerShell in Cloud Shell is to type pwsh in the shell. This will authenticate you into an instance of Cloud Shell with PowerShell without leaving the current Cloud Shell session. Alternatively, you can re-launch the Cloud Shell window by choosing PowerShell from the dropdown menu and confirming to restart.

The Azure PowerShell module is available in Cloud Shell, which allows you to manage your resources in Azure. To view all the Azure PowerShell commands, you can type Get-Command -Module AZ* | more.

You can also run your Bash and Azure CLI commands in the PowerShell console, as it supports both!

Here are some of the tools available in Cloud Shell:

  • Linux Tools: bash, sh, zsh, tmux, and dig
  • Azure Tools: Azure CLI, AzCopy, Azure Functions CLI, blobxfer, Service Fabric CLI, Azure Classic CLI, and Batch Shipyard
  • Text Editors: code, nano, vim, and emacs
  • Containers: Docker Machine, kubectl, Helm, and DC/OS CLI
  • Databases: MySQL client, sqlcmd Utility, PostgreSql client, and mssql-scripter

These tools can be accessed from both PowerShell and Bash, making it easy to manage your resources in Azure.

Security and Authentication

The Azure Cloud Shell offers a secure way to authenticate account access with its Automatic Authentication feature, which helps protect your account information.

This feature specifically supports secure authentication for the Azure PowerShell and Azure CLI, making it easier to manage your account securely.

Automatic Authentication eliminates the need to manually log in each time you access the Cloud Shell, saving you time and reducing the risk of human error.

Drive and File Management

Credit: youtube.com, Manage Your Cloud Drive in Azure Cloud Shell

Azure Cloud Shell provides a convenient way to manage your drives and files through its intuitive interface. You can switch between your local directory and the Azure drive using the cd command, making it easy to navigate and discover Azure resources.

To refresh your Azure resources, simply run dir -Force in the Azure drive. This will update the list of available resources, allowing you to access and manage them with ease.

The Azure drive is a PowerShell drive that exposes your Azure resources as a file system, making it easy to view and manage your subscriptions and resources. You can view your current subscription by running Get-ChildItem or the PowerShell alias dir.

CloudDrive is a 5GB Azure File Share that provides persistent storage to your Cloud Shell instance, allowing you to store scripts, install tooling, and other file-management tasks. To access your Cloud Drive, type cd $Home to access the home drive where Cloud Drive resides, and then type cd ./CloudDrive to enter your persistent CloudDrive storage.

Credit: youtube.com, Using Azure Cloud Shell Editors

You can upload files to Azure via Cloud Shell by clicking on the upload/download icon in the Cloud Shell toolbar and selecting a file on your local machine. By default, uploaded files are saved in your home folder (/home/%USERNAME%), but you can copy them to your clouddrive using the Copy-Item PowerShell command.

Cloud Shell enables $HOME persistence across various sessions by attaching an Azure file share on its first launch. This keeps your files across multiple sessions, and your $HOME directory is stored as a .img in Azure File share.

Management and Integration

Azure Cloud Shell enables deep integration with open-source tools, including Ansible, Terraform, and Chef InSpec. This integration is facilitated through pre-configured authentication and a temporary host based on per user, per session.

Session times out after 20 minutes of interactive inactivity, and Azure file share is used for PowerShell and Bash. Permissions in Bash are set as a regular Linux user, and $HOME is persisted using a 5-GB image in your file share.

Credit: youtube.com, AZ-900 Episode 19 | Azure Tools | Azure Portal, CLI, PowerShell & Cloud Shell

Here are some key features of Azure Cloud Shell's integration with open-source tools:

  • Executes on a temporary host based on per user, per session.
  • Session times out after 20 minutes of interactive inactivity.
  • Uses Azure file share for PowerShell and Bash.
  • Assigns one machine per user account.
  • $HOME is persisted using a 5-GB image in your file share.
  • Sets permissions in Bash as a regular Linux user.

Manage Exchange Online

Managing Exchange Online is easier than you think. You can access a private build of the Exchange Online Module in the PowerShell of the Cloud Shell. To get started, run Connect-EXOPSSession to get your Exchange cmdlets.

You can then run Get-Command -Module tmp_* to see what's available. Additional Azure Cloud Shell Features include the ability to manage Exchange Online with ease.

Open-Source Tool Integration

Azure Cloud Shell offers seamless integration with various open-source tools, making it a one-stop-shop for developers and administrators. This integration enables users to leverage the power of these tools without having to switch between different environments.

One of the key benefits of Azure Cloud Shell's open-source tool integration is its pre-configured authentication for tools like Ansible, Terraform, and Chef InSpec. This means users can start working with these tools right away, without having to spend time setting up authentication.

Credit: youtube.com, APIs and Integration Using Open Source Tools

Azure Cloud Shell's session management is also noteworthy. Each user's session runs on a temporary host, and the session times out after 20 minutes of interactive inactivity. This ensures that resources are not wasted on idle sessions.

Here are some of the open-source tools available in Azure Cloud Shell:

  • Ansible
  • Terraform
  • Chef InSpec
  • Linux tools like bash, sh, zsh, tmux, and dig
  • Azure CLI, AzCopy, Azure Functions CLI, blobxfer, Service Fabric CLI, Azure Classic CLI, and Batch Shipyard
  • Text Editors like code, nano, vim, and emacs
  • Containers like Docker Machine, kubectl, Helm, and DC/OS CLI
  • Databases like MySQL client, sqlcmd Utility, PostgreSql client, and mssql-scripter

By integrating these open-source tools, Azure Cloud Shell provides a comprehensive platform for developers and administrators to manage and deploy applications, infrastructure, and services.

Managing Sessions

Managing sessions can be a bit tricky, but don't worry, I've got you covered.

The Cloud Shell toolbar is the place to go if you need to restart or create a new session to bring up a new container in the background.

If you're idle for more than 20 minutes, the Cloud Shell will terminate the session and you'll be forced to reconnect.

This timeout can catch you off guard if you're in the middle of a task, so be sure to stay active and avoid long stretches of inactivity.

You can easily avoid this issue by regularly interacting with the Cloud Shell and keeping your session active.

Frequently Asked Questions

Is cloud shell the same as PowerShell?

Cloud Shell is based on Linux and uses a .NET Core-based version of PowerShell, which is different from the .NET Framework-based version typically used on Windows. This means it's a variation of PowerShell, but not the exact same experience as the one on Windows.

Margarita Champlin

Writer

Margarita Champlin is a seasoned writer with a passion for crafting informative and engaging content. With a keen eye for detail and a knack for simplifying complex topics, she has established herself as a go-to expert in the field of technology. Her writing has been featured in various publications, covering a range of topics, including Azure Monitoring.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.