In this blog post, I’ll show you how I manage my Virtual Machines on Microsoft Azure using the Azure Cloud Shell and Azure CLI.
About Azure CLI
First release 3 years ago, Azure CLI Is a command line tool for Azure Resource management, The tool can be Install on Linux, MAC, Windows Systems and In the browser using Azure Cloud Shell.
Azure Cloud Shell comes In two flavours, Bash (Linux) and PowerShell, In this blog post I’ll show how to use Bash.
Azure Cloud Shell
Interactive browser-based Shell that allows us to manage Azure resources using Azure CLI commands directory from the browser.
The browsers that are currently supported are Chrome, Edge and Firefox (it’s not recommended to use IE)
Behind the browser, Cloud Shell Is powered by Ubuntu 16.04 LTS with the latest patches.
All sessions that are not active will be terminated after 20 minutes, so make sure you don’t leave the Shell open with unsaved commands.
To log in to Cloud Shell, I browse to the Cloud shell URL below and sign in to the service.
In this post, I’ll use Bash (Linux) because it passed GA and Is more stable
Once logged In I can use the shell
If I type az help, I’ll see all the command that is available to me
Virtual Machine Management
Azure CLI offers all the functionality that is available on the portal using commands.
To manage VMs, I’ll use the syntax below
Using the Shift key on the keyboard we can see all the available commands
az vm + tab
Using the CLI I can create, start, stop and delete VMs,
To view all my VMs, I’ll type:
az vm list --resource-group ntweeklycom
Virtual machines management using Azure Cloud Shell Is a great tool when we need to do reparative tasks that can be automated using commands.
Azure CLI Is also available as a Docker Container, for more details visit our Container Blog article below.