Azure CLI Commands

Azure CLI (Command Line Interface) is a set of commands used to manage Azure resources directly from the command line. It provides a cross-platform command-line tool that allows users to perform tasks such as creating, managing, and deleting Azure resources from Windows, macOS, and Linux.

Install Azure CLI

To install Azure CLI on different operating systems, follow the instructions here.

Login to Azure

az login

This command will open a web browser to authenticate your Azure account.

Create a Resource Group

az group create --name myResourceGroup --location eastus

This command creates a new resource group named myResourceGroup in the eastus region.

Create a Virtual Machine

az vm create --resource-group myResourceGroup --name myVM --image UbuntuLTS --admin-username azureuser --generate-ssh-keys

This command creates a new virtual machine named myVM in the myResourceGroup resource group using the Ubuntu LTS image.

List All Virtual Machines

az vm list --output table

This command lists all virtual machines in your subscription in a table format.

Delete a Resource Group

az group delete --name myResourceGroup --yes --no-wait

This command deletes the resource group named myResourceGroup and all its resources.

References


Last modified February 19, 2025: Update azure-point-to-site-vpn.md (a9c807a)