Manage Azure from Powershell (by Azure CLI)

Petr Kostelanský | 29 August 2021
How to manage Azure resources from Powershell? In general, there are two options Azure CLI or Azure Powershell

 

Azure CLI (Azure Command-Line Interface) is a cross-platform (is for Windows, Linux, or macOS) command-line tool to connect and execute commands on Azure resources.

Azure Powershell is a module for Windows Powershell or Powershell Core and also enables you to connect to Azure and manage resources. But let's skip this for now and look at the Azure CLI

 

Azure CLI

At the beginning, we have to install Azure CLI.

I will use Microsoft installer (MSI) to install Azure CLI on my Windows.

Then you will get access to the CLI through the Windows Command Prompt (CMD) or PowerShell.

 

Let's try our first command (before that I had to restart my pc because I was still getting an error: "'az' is not recognized")

> az version

returns:

{
  "azure-cli": "2.27.2",
  "azure-cli-core": "2.27.2",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {}
}

 For more AZ commands follow Azure CLI documentation.

 

Loading ads...