Which Azure Command line to use?

Which Azure Command line to use?

How do you manage your Azure Resources? Do you prefer to use more visual tool like Azure Portal or use command-line tools like Azure Powershell or Azure CLI?

If you are a visual person like me, you most probably would prefer a visual tool like Azure Portal for managing the Azure resources. The portal is good if you are making some quick changes to some of the Azure resources but it would be a nightmare to use portal if you have to make changes to thousands of Azure resources. In order to automate these changes we will have to use a command line tool. When you will look for options for command line tools you will get following three options:

  • Azure Powershell
  • Azure CLI
  • Azure Cloud Shell

If you are new to the command line tools, you would be wondering which one to use and how do they differ from each other. I found a very good article that explains the pros and cons of the above options in a very detailed manner.

Let's take out Azure Cloud Shell from the equation first, Azure Cloud Shell is accessible using the Web browser and presents two options: Bash (with Azure CLI preinstalled) and PowerShell (with Azure PowerShell preinstalled). Thus, Azure Cloudshell is just a web way of exposing either Azure CLI or Azure Powershell to you. So, if you are a new learner and need to decide which tool to learn, you need to decide between Azure CLI and Azure Powershell.

Azure CLI vs Azure PowerShell

Azure CLI and Azure PowerShell are command-line tools that enable you to create and manage Azure resources. Both are cross-platform, installable on Windows, macOS, and Linux.

Azure CLI

  • Cross-platform command-line interface, installable on Windows, macOS, Linux
  • Runs in Windows PowerShell, Cmd, or Bash and other Unix shells.

Azure PowerShell

  • Cross-platform PowerShell module, runs on Windows, macOS, Linux
  • Requires Windows PowerShell or PowerShell

Different shell environments

Azure CLI is can be run on any of the shell environment. Azure Powershell runs on Windows Powershell and Powershell.

No alt text provided for this image

Which Azure command-line tool is right for you?

When picking the right tool, consider your past experience and current work environment.

Azure CLI syntax is similar to that of Bash scripting. If you work primarily with Linux systems, Azure CLI feels more natural.

Azure PowerShell is a PowerShell module. If you work primarily with Windows systems, Azure PowerShell is a natural fit. Commands follow a verb-noun naming scheme and data is returned as objects.

As I am new to the command line tooling I decided to use the one which will have more intuitive syntax. Please see below some of the syntax of both Azure CLI and Azure Powershell.

No alt text provided for this image

I personally found Azure CLI commands easy to remember and more intuitive and prefer Azure CLI over Azure Powershell.



To view or add a comment, sign in

More articles by Eklavya Gupta

Explore content categories