4 keywords - Azure CLI, Azure PowerShell, Azure Cloud Shell and Bash

cloudguy2020 71 Reputation points
2020-07-19T18:51:25.967+00:00

Hello everyone, Someone please explain why do we have 4 options in Azure cloud for any scripting? Also explain me the differences between the four options as shown below. 1. Azure CLI, 2. Azure PowerShell, 3. Azure Cloud Shell 4. Bash Thanks

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,362 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Leon Laude 85,651 Reputation points
    2020-07-19T19:12:31.027+00:00

    Hi,

    Azure Cloud Shell
    Azure Cloud Shell is a browser-based shell experience to manage and develop Azure resources.
    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.

    Azure CLI
    The Azure command-line interface (Azure CLI) is a set of commands used to create and manage Azure resources. The Azure CLI is available across Azure services and is designed to get you working quickly with Azure, with an emphasis on automation.


    One reason to why where are many different shell languages such as PowerShell and Bash is simply because not everyone are using Windows-based computers, many also run Linux/maCOS, which are more familiar with Bash. Azure offers both options which makes it easier for any customer that come from either a Windows or Linux background to start with Azure.

    Best regards,
    Leon

    22 people found this answer helpful.

  2. Michael Rehnert 106 Reputation points
    2021-10-19T00:24:29.913+00:00

    Just to piggyback off the insightful answer from @Leon Laude , I hope to shine some additional light on the topic since this was once a difficult concept for me to grasp also.

    As previously mentioned, the Azure Cloud Shell is essentially a vehicle to access anything Azure-related and can be accessed from a variety of locations, including the browser and the new Windows Terminal. The difference between the remaining three assets, Bash, Azure PowerShell, and the Azure CLI, is that each is designed to manage a different type of resources. This is where the waters become murky for some, but the answer is actually quite simple, and here is the explanation.

    • Are you trying to manage Windows Servers running in Azure? -- Use Azure PowerShell.
    • Are you trying to manage Linux servers or run Linux-based programs in Azure? -- Use Bash.
    • Are you trying to directly manage Azure resources (Resource groups, Key vaults, Cosmos DB, etc)? -- Use Azure CLI.

    So it depends not so much on which to use in the sense of personal preference, but more in terms of what exactly you want to manage within the Azure ecosystem. I'll close with a helpful reference article that actually first helped me understand the reason that all these options exist.

    21 people found this answer helpful.

  3. Gracey 10 Reputation points
    2023-08-21T11:24:20.2666667+00:00

    To put it simply:

    • "Azure CLI" and "Azure Powershell" are both "Command Line Interfaces" or CLI.
    • Bash is a popular Linux-based CLI. "Azure CLI" is Microsoft's name for their Bash based CLI.
    • Azure Powershell is a Windows-based CLI.
    • To use a CLI, you usually have to download it to your computer. If you don't want to download and install a CLI, you can use Microsoft's browser based CLI called "Azure Cloud Shell".
    • Note that Azure Cloud Sheel gives you the option to use Bash (Linux) or Powershell (Windows) according to your preference.

    Note: Although Azure CLI is Linux-based and Azure Powershell is Windows-based, they both can be configured to run on Windows, Linux, and Mac platforms.

    Hope this helps!.

    2 people found this answer helpful.
    0 comments No comments

  4. BhargaviAnnadevara-MSFT 5,446 Reputation points
    2021-12-16T07:20:27.897+00:00

    @cloudguy2020 Since this is a frequently asked question in the Community, an article covering the similarities, differences and nuances between the various Azure command-line options was added to the documentation recently: Choose the right Azure command-line tool. This doc should answer most of your questions as well (excerpts below).

    When it comes to managing Azure, you have many options. Although Azure CLI, Azure PowerShell, and Azure Cloud Shell have overlapping functionality, each operates differently, and the language is sometimes confused with the environment. Using an Azure command-line tool isn't always necessary, but it's a useful skill to have.

    Azure CLI vs Azure PowerShell:
    Azure CLI and Azure PowerShell are command-line tools that enable you to create and manage Azure resources. While both are cross-platform and installable on Windows, macOS, and Linux, Azure CLI runs in Windows PowerShell, Cmd, or Bash and other Unix shells whereas Azure PowerShell requires Windows PowerShell or PowerShell.

    Different Shell Environments:
    Windows PowerShell, PowerShell, Cmd, and Bash are shell environments. Your shell environment not only determines which tools you can use but also changes your command-line experience.

       Shell Environment | Azure CLI | Azure PowerShell |  
         
       \------------------  
       |-----------|------------------|  
       Cmd               | Yes       |                  |  
       Bash              | Yes       |                  |  
       Windows PowerShell| Yes       | Yes              |  
       PowerShell        | Yes       | Yes              |  
    

    Azure Cloud Shell:
    Azure Cloud Shell is a hosted shell environment that runs on an Ubuntu container. It provides an interactive, authenticated, browser-accessible shell for managing Azure resources. Cloud Shell provides two shell environments: Bash (with Azure CLI preinstalled) and PowerShell (with Azure PowerShell preinstalled) and has integrations for Windows Terminal and Visual Studio Code.

    Choosing a command-line tool:
    Here are a few key factors to remember:

    • 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.
    • Choose the tool that uses your experience and shortens your learning curve.
    • With that said, being open-minded will only improve your abilities. Use a different tool when it makes sense.
    • Keep in mind that feature parity for Azure services doesn't always exist between Azure CLI and Azure PowerShell.

    Hope this helps.

    ----------

    If an answer is helpful, please "Accept answer" and/or "Up-Vote" which might help other community members reading this thread.

    14 people found this answer helpful.
    0 comments No comments

  5. Baskar Nagarajan 15 Reputation points
    2023-02-04T06:51:51.26+00:00

    Microsoft should work on a better nomenclature. This is utterly confusing.

    1. Azure CLI, Azure could shell, Azure power shell, Cmd, bask, window PowerShell, PowerShell.

    phew !

    3 people found this answer helpful.
    0 comments No comments