top of page

Mastering Azure CLI-1

Updated: Sep 12, 2022

Azure Cloud administration using Cloud Shell and Azure CLI - tips and tricks.



This is a multi-part series of posts. In the series of posts you will learn and master how to use azure cli for manging Azure cloud.

Why Azure Cloud Shell?

In this post I am going to show how to use Azure Cloud Shell

Command line is undisputable choice for most of the seasoned administrators. The reason - it's sleek, controlled and you exactly know what you are doing.

Azure Cloud Shell is :

  • interactive

  • authenticated

  • browser-accessible shell

  • Integration with several environment / clients such as

Azure cloud shell provides flexibility of choosing the shell experience between PowerShell (if you come from Windows OS administrative background or Bash (if you come from Linux/Unix OS background).

 

Why Cloud Shell is my favorite?

One of the reason why cloud shell is my favorite interface is it's seamless integration with several open-source tools. It saves me from

  • Downloading and installing tools from different sources (which may sometime lead to installing malicious code on my system).

  • Installing these tools locally leaves lots of foot print

  • Many of them require administrative privileges to update registry etc. which may crash my system).

Treasure of Tools Integrated with Cloud Shell

Look at the list below - you will find a list of tools that are available and have built-in integration with most useful and needed open-source and Microsoft provided tools.

​Category

Name

Linux

bash

zsh

sh

tmux

dig

Azure

Text Editors

code (Cloud Shell editor)

vim

nano

emacs

source control

git

Build Tools

make

maven

npm

pip

Containers

Databases

MySQL client

PostgreSql client

sqlcmd Utility

mssql-scripter

Other

Let us now start and explore cloud shell and then we will

Getting Started with Azure CLI


Azure CLI is has simple syntax. Do pay special attention to order :


$az [ group ] [ subgroup ] [ command] {parameters

Let us break down the above command template

​Componet

Meaning

az

CLI executable

group

represents the Azure service name (why group ? it is called as group because a service may have several sub component)

subgroup

represents sub component of service (group)

command

action such as create, list etc.

parameters

additional information needed to perform the action or complete the action.

Practice Now

It will make more sense if we see this in action.


  • Start cloud shell by clicking on Cloud Shell icon

  • If you are starting cloud for the first time you will be asked to select between Bash or PowerShell.


  • After the first launch you can switch between the shell type by using shell type drop-down.