# data[].attributes.headline
Comparación: Az Powershell - CLI - Cloud shell

# data[].attributes.subject
Comparación: Az Powershell - CLI - Cloud shell

# data[].attributes.attachment_link.readable_text
One of the best tools you can use when working with Azure is PowerShell. I have published an earlier article on how you can connect to Azure Resource Manager (ARM) via PowerShell on your desktop.

Some people still struggle with this as it requires additional software to be installed and configured as well as authentication to the Azure tenant.

Microsoft has provided an easy way to use PowerShell with Azure and it is known as the Cloud Shell.

When you login to the Azure portal you should see a Script icon in the top right, just to the left of the Cog icon.

When you select this icon a window should appear at the bottom of your screen, showing a command line.

In most cases, the environment will default to BASH but you can select PowerShell in the top left of this window.

When you do a new command line environment will open up. It will run PowerShell AND (this is the really cool part) it will AUTOMATICALLY authenticate you to the Azure tenant tenant using the same credentials as you used in the browser to gain access to the Azure portal.

Now you can run your standard PowerShell commands directly in the browser as shown above.

Now the super cool feature of this is that Azure is also available as a mobile app (here in iOS). When you run that app you will again find the option for the Cloud Shell (here in the lower right).

When you select this icon, you'll again be a command line environment that you can configure to be PowerShell as you see above.

Now you can run your PowerShell commands directly from any mobile device! How super cool is that?

Having the ability to run PowerShell from just about anywhere to work with Azure is a really, really powerful feature of Azure and makes the life of managing these resources much easier.

So, go and give it a try for yourself.

Published

# data[].attributes.attachment_link.description
One of the best tools you can use when working with Azure is PowerShell. I have published an earlier article on how you can connect to Azure Resource Manager (ARM) via PowerShell on your desktop.Some people still struggle with this as it requires additional software to be installed and configured as well as authentication to...

# data[].attributes.body
https://www.msp360.com/resources/blog/azure-cli-vs-powershell/

# data[].attributes.attachment_link.readable_text
Azure CLI vs PowerShell: What Is the Difference?

Before we talk about Azure PowerShell vs Azure CLI, first of all, we need a bit of background. Both are available in the Azure cloud or you can use them remotely from your workstation. On your workstation, you will have to install a module, which we will explain later, but both are available in Azure Cloud Shell. Azure CLI is short for the Azure command-line interface.

In Azure, at the top of your screen in the middle, you have an icon for a command prompt. When you click on that icon, you will enter Azure Cloud Shell.

You will have a choice then to choose between PowerShell or Bash. If you wish to manage Windows-based VMs, you will choose PowerShell; on the other hand, if you want to manage Linux VMs, Bash is the option you need. Bash is a Unix shell that was invented in 1989, while PowerShell was invented in 2006.

Both Bash and PowerShell are scripting languages. This simply means that they are already compiled code that issues commands to the OS. Bash issues commands to form strings, while PowerShell forms objects.

With that said, you then have Azure CLI, which is used to issue a set of commands to add, delete, or modify resources in Azure. By that, I mean the actual Azure resources and not the operating system that resides on the resources. Azure CLI is available in both the Bash and PowerShell sections of Azure Cloud Shell.

Differences between Bash and PowerShell

PowerShell is a command shell and associated scripting language for the majority of Windows operating systems. Bash is a Unix shell and scripting language for most Linux operating systems. The first version of PowerShell was introduced in 2006. The Bash shell appeared in 1989. PowerShell treats input and output as objects, while Bash always accepts input and output as text structures. The user interface of PowerShell is a command-line interface; that of Bash is a text command-line interface. PowerShell can be used on any version of Windows from Windows 97 onward. Bash is mainly used with Linux and Unix operating systems. Powershell is a scripting language based on the .NET framework and C# programming language, while Bash is a scripting language based on the C programming language.

Further reading 10 Useful PowerShell Commands

Azure CLI first came out with commands that started with azure, azureRM and now az. The Azure CLI can be installed on your workstation and is used to issue commands remotely to the Azure cloud by installing a module in PowerShell. To do this, run the following command in PowerShell as an administrator:

Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi;
Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi

You will then be able to access the CLI at the windows command prompt (CMD) or in PowerShell. To log in, you run:

az login

This will open up a new browser window to log in to Azure. Then you will be able to run Azure CLI commands. Azure CLI can be run in both PowerShell and CMD, but PowerShell gives you more tab-completion features.

Here is a list of common commands with the CLI:

To put it simply, Azure PowerShell vs Azure CLI means that it all depends on what you want to do in Azure. You can use both in Cloud Shell in PowerShell, and you can use both remotely at your workstation to manage the Azure cloud. If it's resources in Azure that you want to manage, then use Azure CLI; and if you need to manage Windows Servers, then use Azure PowerShell.

Hopefully, this clears up the meaning of the various terms and descriptions that you will find in Azure. It will also get you started in managing your resources and VMs in the cloud.

# data[].attributes.attachment_link.title
Azure CLI vs PowerShell: The Difference Explained

# data[].attributes.attachment_link.description
Azure CLI vs PowerShell: What Is the Difference? Before we talk about Azure PowerShell vs Azure CLI, first of all, we need a bit of background. Both are available in the Azure cloud or you can use them remotely from your workstation.

# data[].attributes.headline
Choose the right Azure command-line tool

# data[].attributes.subject
Choose the right Azure command-line tool

# data[].attributes.body
https://docs.microsoft.com/en-us/cli/azure/choose-the-right-azure-command-line-tool

# data[].attributes.attachment_link.title
Choose the right Azure command-line tool - Azure CLI

# data[].attributes.attachment_link.description
Learn which Azure command-line tool fits your needs with an Azure CLI vs Azure PowerShell comparison — get started with your preferred command-line tool.

# data[].attributes.attachment_link.title
Quickstart - Choosing the right command-line tool for Azure

# data[].attributes.attachment_link.description
Learn the differences between AzureCLI and Azure PowerShell

# data[].attributes.body
En resumen PowerShell y Bash son interfaces de línea de comando para administrar Windows y Linux.

Azure CLI son los comandos que permiten administrar los recursos de Azure desde estas interfaces de comando.

# data[].attributes.attachment_link.readable_text
¿Azure CLI, Azure PowerShell, Azure Cloud Shell, Bash?

Uno de los obstáculos cuando comenzamos a familiarizarnos con Azure, es que debemos aprender un nuevo vocabulario y el tema de herramientas de administración, no está exento de este desafío.

Si bien todas suenan similares y diferentes al mismo tiempo, todo este enredo tiene una lógica que espero ayudarte a comprender en este artículo.

Es importante conocer cuál es la diferencia entre estas herramientas y cómo están relacionadas con la administración de ambientes de Azure.

Para comenzar, veamos una breve descripción de cada uno de estos elementos para luego comprender de qué manera están relacionados y lo más importante, comprender cómo se utilizan en el ambiente de Azure.

PowerShell

PowerShell es básicamente una consola basada en texto, que nos permite administrar nuestros sistemas operativos tal como se hace en sistemas operativos basados den Unix.

Adicionalmente, PowerShell es una plataforma que permite la automatización de tareas mediante su lenguaje srcipt.

En el 2016, PowerShell fue liberado como código open source y se convirtió en una herramienta multi-plataforma.

Ejemplo Windows PowerShell

Nota: En 2016 Microsoft hizo público el código fuente de PowerShell y este pasó a llamarse PowerShell core, desde la versión 6 en adelante, también puedes usar PowerShell en otros sistemas operativos.

Estas son las versiones disponibles de PowerShell y sus respectivos nombres según la versión.

Bash

Bash es un interprete de órdenes para Linux que se ejecuta en una ventana de texto donde el usuario escribe órdenes o comandos para que estos sean ejecutados por el sistema operativo similar a PowerShell.

GNU bash en Linux CenOS

Esta herramienta también permite administrar sistemas operativos basados en Linux y también permite la automatización de tareas.

Entonces contamos con 2 interfaces de línea de comando, PowerShell que funciona tanto en Windows como en Linux y Bash que funciona para Linux.

PowerShell y Bash

Azure CLI

Azure command-line interface o interfaz de línea de comandos de Azure, es un conjunto de comandos utilizados para crear, eliminar y administrar recursos de Azure.

Este conjunto de comandos se instala en Windows como un módulo de PowerShell y en Linux como un paquete para Bash.

Azure PowerShell

Azure PowerShell es un Módulo de PowerShell con comandos para agregar, eliminar o modificar recursos en Azure.

El módulo de Azure PowerShell está disponible tanto en Windows como en Linux y también en Azure Cloud Shell que veremos más adelante.

Relación entre Azure PowerShell en Windows y en Linux

Azure Cloud Shell

Ahora que entendemos la diferencia entre PowerShell, Bash, Azure PowerShell y AzureCLI, podemos hablar de Azure Cloud Shell.

Azure, siendo una plataforma en la nube, brinda la posibilidad de utilizar Azure CLI mediante un navegador Web sin necesidad de tener un sistema operativo local tipo Windows o Linux.

Puedes iniciar una consola de Cloud Shell mediante el ícono de la barra principal del portal de Azure.

Puedes seleccionar si deseas trabajar con PowerShell o con Bash dependiendo de la tarea que desees realizar tal como se aprecia en la imagen más abajo.

Si deseas tener una experiencia con más espacio, también tienes la opción de ir a la dirección https://shell.azure.com/

Consolas de Azure Cloud Shell con PowerShell y Bash

Como puedes ver, desde un navegador web, podemos tener acceso tanto a PowerShell como a Bash y por ende, contamos también con Azure CLI.

Azure cloud shell con PowerShell y con Bash

Conclusión

En pocas palabras, PowerShell y Bash son interfaces de línea de comando para administrar Windows y Linux.

Azure CLI son los comandos que permiten administrar los recursos de Azure desde estas interfaces de comando.

Azure Cloud Shell es una solución Web que nos permite utilizar PowerShell, Bash y en ambas se encuentran instalados los comandos de Azure CLI

# data[].attributes.attachment_link.title
Azure CLI vs Azure PowerShell vs Azure Cloud Shell - Blog TutorMas

# data[].attributes.attachment_link.description
Uno de los obstáculos cuando comenzamos a familiarizarnos con Azure, es que debemos aprender un nuevo vocabulario y el tema de herramientas de administración, no está exento de este desafío. Si bien todas suenan similares y diferentes al mismo tiempo, todo este enredo tiene una lógica que espero ayudarte a comprender en este artículo.

# data[].attributes.attachment_link.readable_text
If you are just learning about Azure, most likely you are working in the Azure Portal. You have probably created resources like virtual machines and storage accounts by using the deployment wizards. However, this process is tedious and doesn't scale when you need to create lots of resources. If you want to take your Azure resource deployment to the next level, it is time to look at the Azure CLI!

In this tutorial, you will learn what the Azure CLI is, how to connect to your Azure tenant, and how to deploy your first resources. If you are more familiar with Azure PowerShell, you will also learn some differences between the two languages.

What is Azure CLI?

Azure CLI is a command-line tool to create and manage resources. You interact with Azure by running commands in a terminal or writing scripts to automate tasks. Azure CLI interacts with the Azure Resource Manager (ARM) service, which is the management layer to interact with resources in your account.

Azure CLI Features

The Azure CLI offers many great features for managing Azure resources.

Cross-Platform: You can install Azure CLI on Linux, Mac, or Windows computers. You can even run Azure CLI from inside a Docker container.

Multiple Shell Environments: Azure CLI works in multiple shell environments, such as Windows Command prompt, Bash, and PowerShell.

Bash-like Syntax: If you are a Linux administrator, the Azure CLI syntax is similar to Bash scripting. This similarity helps Azure CLI feel more natural and easy to learn.

Automation: You can automate Azure management tasks by writing scripts with Azure CLI, such as creating, modifying, or deleting resources.

Open-Source: Microsoft hosts the source code for Azure CLI in GitHub, and community members can contribute to the project.

Azure CLI can also work with infrastructure as code languages like ARM templates and Azure Bicep. To learn more about these infrastructure as code formats, check out the articles below!
Exploring ARM Templates: Azure Resource Manager Tutorial Azure Bicep: Getting Started and How-To Guide
How to Install Azure CLI

Now that you understand a bit more about the Azure CLI, it's time to get it installed! As mentioned above, Azure CLI is cross-platform, meaning you can install it on most platforms. Check out the following sections on how to install the Azure CLI on the platform of your choice.

Windows

For Windows-based systems, Microsoft provides an MSI installer for the Azure CLI. The MSI is for new installations and upgrades to existing versions. You can find the current release of the Azure CLI here.

As an alternative, you can use PowerShell commands to download and install the latest version of Azure CLI. The example code below shows how to download and install Azure CLI. Be sure to run the following steps from PowerShell started as an administrator. Once the installation is successful, restart the PowerShell console to use the Azure CLI commands.

# Download the latest MSI installer and save as AzureCLI.msi
Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi

# Start the installation and wait for completion
Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'

# Remove the downloaded MSI installer
Remove-Item .\AzureCLI.msi

Linux

The Azure CLI is available for multiple Linux distributions such as Ubuntu, Debian, Red Hat, CentOS, and more. Microsoft recommends installing the Azure CLI using your Linux distribution's preferred package manager so you can make sure to always get the latest updates.

If you don't have any of the above package managers available, you can manually install Azure CLI across all Linux platforms. To manually install Azure CLI, your system requires the following software:

To install or update Azure CLI, run the following script:

curl -L https://aka.ms/InstallAzureCli | bash

Mac

You install Azure CLI on the macOS platform using the homebrew package manager. Homebrew is an easy way to keep your Azure CLI installation up to date. Azure CLI currently supports macOS version 10.9 and later.

To install Azure CLI on your macOS system, update your brew repository information and run the install command, like this:

brew update && brew install azure-cli

Azure Cloud Shell

If you don't want to manage Azure CLI on your local system, you can use the Azure Cloud Shell. The Azure Cloud Shell is an interactive shell environment that runs in your browser. It automatically authenticates to your Azure tenant so you can quickly start managing resources.

The Azure Cloud Shell provides both Bash and PowerShell experiences so you can pick your favorite. Each environment automatically includes the latest version of the Azure CLI. Below is a screenshot showing the Bash shell and running az --version to display the Azure CLI version.

To access the Azure Cloud Shell, navigate to https://shell.azure.com. If you've never accessed the shell before, you are prompted to create a storage account for persisting files across sessions. To read more about this process, checkout persisting files in Azure Cloud Shell.

Azure CLI vs. Azure PowerShell

Azure CLI and Azure PowerShell are command-line tools that allow you to manage your Azure resources and environment. Both tools support installation on Windows, macOS, and Linux. However, Azure CLI supports more shell environments, like Windows Command prompt and Bash, whereas Azure PowerShell is only supported in PowerShell.

Check out the table below for a comparison of support shell environments.

When choosing which command-line tool is right for you, consider your past experience and what type of environment you work in. If you are primarily a Linux administrator, the Azure CLI syntax is similar to Bash scripting. Learning Azure CLI may feel more natural than learning Azure PowerShell.

The Azure CLI follows a syntax where each commands begins with the reference name az followed by the name of a resource. After the reference name is the command name, which designates which resource you are working with. Finally, many commands also have parameters for passing values, such as a resource group name.

Below is an image that shows an example command to set the Azure subscription. Setting the Azure subscription tells Azure CLI where to create or find resources to manage. The example command shows the reference name ( az account), the command ( set), the parameter name (--subscription), and the parameter value ( Pay-As-You-Go).

If you primarily work in a Windows environment, Azure PowerShell may be the better choice. All Windows operating systems come with PowerShell already installed. Azure PowerShell is a PowerShell module you install from the PowerShell Gallery.

While you may develop a preference for a command-line tool, it is important to be familiar with both. Both tools do not have full feature parity for Azure services, so you may need to use one tool when the other doesn't support a service or command.

To learn more about managing Azure and Office 365 using PowerShell, check out How to Connect to Office 365 PowerShell: Azure AD Modules.

Managing Resources with Azure CLI

Now that you understand the Azure CLI a bit more, it is time to see it in action! The following sections demonstrate how to access your tenant, view your subscriptions, and create a few Azure resources.

Signing in to Azure

Azure CLI supports multiple authentication methods to sign in to your Azure environment. The default authentication method uses an interactive log-in through a web browser. Run the az login command to get started, and the CLI will open your default browser to an Azure sign-in page. Enter your credentials or select an already signed-in account to complete the sign-in process.

If a browser doesn't open automatically, you can use an authorization code to sign in to Azure. Add the --use-device-codeparameter to the same log-in command. Navigate to the URL ( https://microsoft.com/devicelogin) and enter the authorization code. Once Azure verifies the authorization code, you then enter your user name and password.

Selecting an Azure Subscription

When you sign in to your Azure tenant, the Azure CLI displays a list of subscriptions you have access to. Azure subscriptions are a logical grouping of resources for billing and management purposes. If you don't make any changes, Azure CLI uses the default subscription when you start creating resources.

Use the az account show command to view the default subscription. In the example screenshot below, the default subscription is named Demo and has a unique ID starting with 5b5.

If you need to view all subscriptions later in your session, use the az account list command. Azure CLI displays information about each subscription, such as the unique ID and name. Find the subscription you want to work with and note either the ID or name.

In the example screenshot below, the subscription name starts with 7458, and the name is Production.

If you need to switch subscriptions before creating new resources, use the az account set command. The example below sets the subscription to Production. When selecting another subscription, you can use the subscription ID or display name.

# Set the subscription using the display name
az account set --subscription "Production"

# Set the subscription using the unique ID
az account set --subscription 7458ed71-ed9d-45f4-b34e-793a2472800f

Creating Resources using Azure CLI

Now that you are logged into Azure and selected your subscription, it is time to create some resources! In the remaining steps, you will make a resource group followed by creating a storage account.

To create a resource group, use the az group create command followed by the group name (AzureCliDemo) and the Azure region (WestUS2). You can select any name and Azure region you'd like.

az group create --name 'AzureCliDemo' --location 'WestUS2'

With the resource group created, create the storage account using the az storage account create command. Specify a globally unique storage account name (azclistfacctdemo) along with the resource group name (AzureCliDemo) and Azure location (WestUS2).

Next, specify the storage account properties, such as the SKU (Standard_LRS), the kind of storage account (StorageV2), and the default access tier (Cool).

az storage account create `
  --name 'azclistgacctdemo' `
  --resource-group 'AzureCliDemo' `
  --location 'WestUS2' `
  --sku 'Standard_LRS' `
  --kind 'StorageV2' `
  --access-tier 'Cool'

Congratulations! You just created your first resources using the Azure CLI!

Azure CLI FAQs

What is Azure CLI used for?

Azure CLI is a command-line utility used to create and manage Azure resources. You can use the Azure CLI to issue single commands to your Azure environment or write a script with several commands to automate a task.

What is the difference between Azure CLI and Azure PowerShell?

Azure CLI and Azure PowerShell use different syntax to accomplish their actions. While both work on multiple platforms, Azure CLI works in shell environments that Azure PowerShell does not, like Windows Command prompt and Bash on Linux.

Closing

In this article, you learned about the Azure CLI and the benefits of using it. You then saw how you can install Azure CLI on multiple platforms and then signed in to your Azure tenant and created your first resources.

Azure CLI is a fantastic tool to learn to manage your Azure environment. By leveraging Azure CLI, you can accomplish tasks more quickly and standardize repeatable tasks. The Bash-like syntax makes the Azure CLI a natural choice for your shell experience if you're a Linux administrator.

# data[].attributes.attachment_link.title
Azure CLI Overview: Setup, Comparison, and Integration Tips | Varonis

# data[].attributes.attachment_link.description
If you are just learning about Azure, most likely you are working in the Azure Portal. You have probably created resources like virtual machines and storage accounts by using the deployment wizards. However, this process is tedious and doesn't scale when you need to create lots of resources.

# data[].attributes.body
Realizar una actividad comparativa entre los servicios de Azure Power Shell, Azure Cli y Cloud Shell.