Azure: CLI - 1

Azure Cli

The Azure Command-Line Interface (CLI) is a cross-platform command-line tool to connect to Azure and execute administrative commands on Azure resources. It allows the execution of commands through a terminal using interactive command-line prompts or a script.

Install Azure CLI on macOS

  • Mac with Intel CPU
brew update && brew install azure-cli

Install Azure Cli with Docker

  • Use docker run
docker run -it mcr.microsoft.com/azure-cli
  • Run with SSH key
docker run -it -v ${HOME}/.ssh:/root/.ssh mcr.microsoft.com/azure-cli

Get Started

  • Sign In
az login
  • Show accounts
az account list 
az account show

  • Setup default subscription
az account set --sbuscription XXXX-XXXXX-xXXXX-XXX
  • Show App Services
az appservice plan list --query-examples
  • Show Web Apps
az webapp  list --query-examples