AzureFunBytes Short – Cloud Shell

Jay Gordon

Jay

The Azure Cloud Shell is one of my favorite things about using Azure. Many of the administrative tasks that I may have had to run from a local computer can now be done from a browser anywhere I can authenticate into my Azure account. I used to always worry about needing a computer that had a shell or a terminal program with my ssh key on it all the time. Now, I keep much of this on my Azure Cloud Shell on my local computer so I can work pretty much anywhere.

Azure Cloud Shell is an interactive, authenticated, browser-accessible shell for managing Azure resources. It provides the flexibility of choosing the shell experience that best suits the way you work, either Bash or PowerShell.

With Azure Cloud Shell, you’ll have full access to create, modify, manage, and destroy your Azure resources [right from your browser or your local terminal..

Azure Cloud Shell includes an integrated file editor built from the open-source Monaco Editor. The Cloud Shell editor supports features such as language highlighting, the command palette, and a file explorer.

The Azure Cloud Shell can run either bash or Powershell.

FYI: Creating storage is only required the first time!

  1. Launch Cloud Shell from the top navigation of the Azure portal.

  2. Select a subscription to create a storage account and Microsoft Azure Files share.

  3. Select “Create storage”

  4. Select the Bash environment.

Great. Now let’s open a new tab from the Cloud Shell and get a full-size shell, or you can just navigate your browser to https://shell.aure.com to access full view:

There are a number of tools that as a SysAdmin moving to the Cloud you may find helpful.

Cool Tools!

Let’s look at some of the CLI tools available to make your life much easier when you’re getting started with Azure.

code

There’s a simple version of VS Code that’s part of your Azure Cloud Shell Envrionment that will allow you to create or edit files right in your shell. Need a scratch pad while running a demo? That’s another really cool feature. To access it, just type code in your shell:

Ansible

Ansible is a tool for automating apps and infrastructure by utilizing YAML based playbooks that have become part of many SysAdmin’s daily tasks.

Ansible is ready to use in the Azure Cloud Shell permitting you to begin immediately with existing playbooks you may have written elsewhere. No agents are required, just prep your ssh key and get working.

You can watch my full video on using Ansible with Azure here:

kubectl

If you plan on using the Azure Kubernetes Service, you’re going to need to familiarize yourself with kubectl which is available right in your Cloud Shell with no additional installation required. Kubectl is the command line interface you’ll use to work with your AKS clusters.

Here’s an example of using kubectl to get credentials of an AKS cluster I built along with the status of the cluster nodes:

Hashicorp Terraform

Another really popular method of deploying your infrastructure to Azure is by using Terraform by Hashicorp. Hashicorp Terraform is an open-source tool for provisioning and managing cloud infrastructure. It codifies infrastructure in configuration files that describe the topology of cloud resources. These resources include virtual machines, storage accounts, and networking interfaces. The Terraform CLI provides a simple mechanism to deploy and version the configuration files to Azure.

Terraform is adept at deploying an infrastructure across multiple cloud providers. It enables developers to use consistent tooling to manage each infrastructure definition.

You can read more information on Terraform on Azure at the following links:

Terraform with Azure
Quickstart: Configure Terraform using Azure Cloud Shell
Create a Kubernetes cluster with Azure Kubernetes Service using Terraform
Tutorial: Terraform testing overview

az

Of course Azure is going to have CLI tools for you to manage your resources! The az tool is everything you need right from the same browser-based shell! The Azure command-line interface (CLI) is Microsoft’s cross-platform command-line experience for managing Azure resources. The Azure CLI is easy to learn and the perfect tool for building custom automation that works with Azure resources.

I really recommend checking out the Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure CLI tutorial to get a great walk-through of using AKS along with the Azure CLI.

ssh

Having a place you can always ssh into the production environment that you trust is important. Cloud Shell allows you to provide your ssh keys as you would in almost any other “Linux” environment to log into systems when you need to.

AzureFunBytes!

Byte-sized content with a live Twitch show!

Learn about Azure fundamentals with me!

Live stream is available on Twitch at 2 pm EST Thursday.

Join me, ask questions, and learn about Azure!

You can also find the recordings:

AzureFunBytes on Twitch
AureFunBytes on Twitter
AzureFunBytes on YouTube

0 comments

Comments are closed. Login to edit/delete your existing comments