Azure Cloud Shell Tips for SysAdmins (bash)
Tags: azure, devops, sysadmin, linux
Published: 2019-06-05 16:59:22

---
title: Azure Cloud Shell Tips for SysAdmins (bash)
published: true
series: SysAdmin-Tips
description: SysAdmin hints for using Azure Cloud Shell. 
tags: azure, devops, sysadmin,  linux,
---

As an Azure Advocate, one of the things I spend my time doing is learning the easiest ways for beginners to use Microsoft Azure. Today I want to share with you a few ways to utilize some tools that are built right into Azure.

The [Azure Cloud Shell](https://azure.microsoft.com/en-us/features/cloud-shell/?WT.mc_id=devto-blog-jagord) 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 am keeping much of this on my Azure Cloud Shell so I can work pretty much anywhere.

The Azure Cloud Shell can run either [bash](https://docs.microsoft.com/azure/cloud-shell/quickstart?WT.mc_id=devto-blog-jagord) or [Powershell](https://docs.microsoft.com/en-us/azure/cloud-shell/quickstart-powershell?WT.mc_id=devto-blog-jagord).  


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](https://shell.azure.com) to access full view:

![](https://thepracticaldev.s3.amazonaws.com/i/v556tb9l4swzfi6043v6.png)

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 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:

![](https://thepracticaldev.s3.amazonaws.com/i/c3iuocr1h066gedg6s8h.gif)

### 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:

{% youtube dBvLrjrB82Y %}

### kubectl

If you plan on using the [Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/kubernetes-service/?WT.mc_id=devto-blog-jagord), you're going to need to familiarize yourself with [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) 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:


![](https://thepracticaldev.s3.amazonaws.com/i/s6z03seb2tjia7k28bki.png)

### 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)](https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest?WT.mc_id=devto-blog-jagord) 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](https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough?toc=%2fcli%2fazure%2ftoc.json/?WT.mc_id=devto-blog-jagordd) 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.


## Any more tips?

Any more tips you'd like me to provide you?  I am always looking to listen to what people from various level of experience are looking to learn about.  Please leave a comment below!

Thanks and enjoy using Azure!