Skip to content

Azure CLI

160 commands

Microsoft’s cross-platform CLI for Azure: manage subscriptions, Entra ID, VMs, storage and networking, and review security posture.

  • Azure
  • cloud
  • Entra ID

Install Azure CLI

brew install azure-cli

Basic Syntax and Help3

az --help

Displays the global help menu and available command groups.

az version

Shows the installed Azure CLI version and dependent libraries.

az upgrade

Updates the Azure CLI to the latest available version automatically.

Link

Configuration1

az configure

Interactively manages default settings such as output format and logging.

Extensions1

az extension add

Installs a specific Azure CLI extension to add functionality.

Link

Authentication3

az login

Initiates the interactive login process via the default web browser.

az login --use-device-code

Logs in using a device code, suitable for terminals without browsers.

az login --service-principal

Authenticates using a service principal for automation workflows.

Link

Subscription Management3

az account list

Lists all subscriptions available to the logged-in account.

Link
az account set

Sets the active subscription for subsequent commands.

Link
az account show

Displays details of the currently active subscription.

Link

Resource Group Management5

az group create

Creates a new resource group in a specific region.

Link
az group list

Lists all resource groups in the current subscription.

Link
az group show

Gets the metadata and properties of a specific resource group.

Link
az resource list

Lists all resources contained within a specific resource group.

Link
az group lock create

Applies a management lock to prevent accidental deletion of the group.

Link

Compute Operations10

az vm list-skus

Lists available virtual machine sizes and SKUs in a region.

Link
az vm create

Creates a Linux virtual machine with SSH key authentication.

Link
az vm list

Lists all VMs with their power state and IP details.

Link
az vm show

Retrieves detailed configuration information for a specific VM.

Link
az vm open-port

Opens a network port on the VM's associated network security group.

Link
az vm stop

Power off a virtual machine (deallocates compute resources).

Link
az vm start

Starts a stopped virtual machine.

Link
az vm run-command invoke

Executes a shell script inside the VM using the VM Agent.

Link
az disk list

Lists managed disks associated with a resource group.

Link
az snapshot create

Creates a point-in-time snapshot of a managed disk.

Link

Network Management7

az network vnet create

Creates a virtual network with a specified address space.

Link
az network vnet subnet create

Adds a subnet to an existing virtual network.

Link
az network public-ip create

Creates a public IP address resource.

Link
az network nsg create

Creates a Network Security Group for traffic filtering.

Link
az network nsg rule create

Adds an inbound security rule to an NSG.

Link
az network nsg rule list

Lists all rules defined in a Network Security Group.

Link
az network nic create

Creates a network interface card and attaches it to a subnet and NSG.

Link

Storage Management5

az storage account create

Creates a general-purpose storage account.

Link
az storage account keys list

Lists the access keys for a storage account (Handle with care).

Link
az storage container create

Creates a blob container within a storage account.

Link
az storage blob upload

Uploads a local file to a storage container as a blob.

Link
az storage blob list

Lists all blobs contained in a specific container.

Link

Identity and Access5

az ad user list

Lists all users in the Azure Active Directory tenant.

Link
az ad user show

Gets specific details about an Azure AD user.

Link
az ad group create

Creates a new security group in Azure AD.

Link
az ad group member add

Adds a user or service principal to a group.

Link
az ad sp create-for-rbac

Creates a service principal and assigns it a role.

Link

Role-Based Access Control3

az role definition list

Lists details of a specific role definition.

Link
az role assignment create

Assigns a role to a user or principal at a specific scope.

Link
az role assignment list

Lists all roles assigned to a specific user.

Link

Key Vault3

az keyvault create

Creates an Azure Key Vault for managing secrets and keys.

Link
az keyvault secret set

Stores a secret value in the Key Vault.

Link
az keyvault secret show

Retrieves the value of a secret from the Key Vault.

Link

App Service3

az webapp list

Lists all web applications in a resource group.

Link
az appservice plan create

Creates an App Service plan to host web apps.

Link
az webapp create

Creates a web application running a specific runtime.

Link

Containers (AKS)2

az aks create

Creates a managed Kubernetes cluster.

Link
az aks get-credentials

Configures the local kubectl to connect to the AKS cluster.

Link

Container Registry2

az acr create

Creates an Azure Container Registry.

Link
az acr login

Logs in to the container registry via the Docker CLI.

Link

Databases (SQL)3

az sql server create

Creates a logical SQL server.

Link
az sql db create

Creates a SQL database within a logical server.

Link
az sql server firewall-rule create

Allows access to the SQL server from a specific IP address.

Link

Monitoring3

az monitor activity-log list

Lists activity log events for the subscription from the last hour.

Link
az monitor metrics list

Retrieves metric definitions and values for a resource.

Link
az monitor diagnostic-settings create

Configures streaming of logs to a Log Analytics workspace.

Link

Output Formatting3

az group list --output json

Outputs command results in JSON format.

Link
az group list --output table

Outputs command results in a human-readable ASCII table.

Link
az group list --output tsv

Outputs results in Tab-Separated Values, useful for scripting variables.

Link

JMESPath Querying2

az vm list --query

Filters and projects specific fields from the output using JMESPath.

Link
az vm list --query (Filter)

Filters the list to show only resources in a specific location.

Link

Resource Tagging2

az tag update

Updates tags on a resource without replacing existing tags.

Link
az resource list --tag

Lists all resources that have a specific tag key and value.

Link

Policy and Compliance2

az policy definition list

Lists built-in Azure policy definitions.

Link
az policy assignment create

Assigns a policy to a scope to enforce compliance.

Link

Blue Team Validation (Network)3

az network nsg rule list (Audit)

Audits NSGs to find rules that allow all inbound traffic.

Link
az network public-ip list

Lists all public IP addresses and shows what they are attached to.

Link
az network watcher test-ip-flow

Verifies if traffic is allowed or denied to a VM based on effective security rules.

Link

Blue Team Validation (Identity)2

az role assignment list (Privileged)

Audits all users who have the Owner role on the subscription.

Link
az ad user list (Guest)

Identifies all guest users existing in the Azure Active Directory.

Link

Blue Team Validation (Storage)1

az storage account list (Public Access)

Finds storage accounts that allow public access to blobs.

Link

Blue Team Validation (KeyVault)1

az keyvault list (Deleted)

Lists soft-deleted Key Vaults to detect potential data loss or recovery needs.

Link

Security Posture3

az security alert list

Lists active security alerts from Microsoft Defender for Cloud.

Link
az security score list

Retrieves the current Secure Score for the subscription.

Link
az security jit-policy list

Lists Just-In-Time access policies configured for VMs.

Link

Incident Response (Logs)1

az monitor activity-log list (Filter)

Investigates all actions performed by a specific user since a given time.

Link

Incident Response (Compute)2

az vm run-command invoke (Forensics)

Remotely executes netstat on a compromised VM to identify active connections.

Link
az snapshot create (Forensics)

Creates a forensic copy of a disk for offline analysis.

Link

Incident Response (Network)1

az network watcher packet-capture create

Starts a packet capture on a VM to analyze network traffic patterns.

Link

Automation3

az deployment group create

Deploys infrastructure as code using an ARM template or Bicep file.

Link
az deployment group validate

Validates a template syntax and configuration without deploying it.

Link
az deployment operation list

Lists the individual operations within a deployment for debugging.

Link

Managed Identity2

az identity create

Creates a User-Assigned Managed Identity.

Link
az vm identity assign

Assigns a managed identity to a virtual machine.

Link

Advanced Networking4

az network lb create

Creates a standard Layer 4 Load Balancer.

Link
az network lb probe create

Creates a health probe to monitor backend instances.

Link
az network lb rule create

Creates a load balancing rule forwarding traffic from frontend to backend.

Link
az network application-gateway create

Creates a Layer 7 Application Gateway for web traffic management.

Link

Advanced Storage2

az storage share create

Creates an Azure File Share.

Link
az storage message put

Adds a message to an Azure Storage Queue.

Link

Advanced Compute2

az vm image list

Lists all available VM images for a specific offer.

Link
az vm availability-set create

Creates an availability set to ensure high availability of VMs.

Link

Cost Management3

az consumption usage list

Lists usage details for billing analysis.

Link
az consumption budget create

Creates a budget to monitor spending.

Link
az consumption usage list

Forces Microsoft billing API extractions bypassing graphical dashboards delivering raw transactional utilization metrics.

Link

DevSecOps2

az pipelines list

Lists Azure DevOps pipelines (requires azure-devops extension).

Link
az repos list

Lists Git repositories in Azure DevOps.

Link

Function Apps2

az functionapp create

Creates a serverless Function App.

Link
az functionapp deployment source config-zip

Deploys code to a Function App from a zip file.

Link

Data & Analytics2

az cosmosdb create

Creates a Cosmos DB account.

Link
az eventhubs namespace create

Creates an Event Hubs namespace for data ingestion.

Link

Security Auditing (Disk)1

az disk list (Encryption)

Audits managed disks to find those without encryption enabled.

Link

Security Auditing (SQL)1

az sql server audit-policy show

Checks the auditing policy of a SQL server.

Link

Advanced Security4

az keyvault certificate create

Creates a self-signed certificate inside Key Vault.

Link
az keyvault key create

Creates a cryptographic key in Key Vault.

Link
az network firewall create

Creates an Azure Firewall resource.

Link
az network firewall network-rule create

Adds a network rule to the Azure Firewall.

Link

Hybrid Management1

az arcappliance list

Lists Azure Arc appliances for hybrid cloud management.

Link

IoT2

az iot hub create

Creates an IoT Hub for device management.

Link
az iot hub device-identity list

Lists devices registered to an IoT Hub.

Link

Logic Apps2

az logic workflow create

Creates a Logic App workflow from a JSON definition.

Link
az logic workflow show

Extrapolates full automation configuration trees evaluating structural pipeline integrations.

Link

Container Instances2

az container create

Creates a single container instance (ACI) accessible via a public IP.

Link
az container logs

Retrieves logs from a container instance.

Link

Global Traffic2

az network traffic-manager profile create

Creates a Traffic Manager profile for global DNS load balancing.

Link
az network front-door create

Creates an Azure Front Door for global web traffic acceleration.

Link

Operational Hygiene3

az resource list (Orphans)

Lists resources that are not managed by another resource (potential orphans).

Link
az monitor log-analytics workspace list

Lists Log Analytics workspaces used for log aggregation.

Link
az monitor autoscale setting list

Lists autoscale settings configured for resources.

Link

Advanced Identity2

az ad sp credential list

Lists the credentials (passwords/certs) associated with a service principal.

Link
az ad app list

Lists App Registrations in Azure AD.

Link

Diagnostics2

az network watcher troubleshooting start

Starts a troubleshooting session on a VPN Gateway or Connection.

Link
az webapp log tail

Streams live logs from a Web App to the console.

Link

Batch Processing1

az batch account create

Creates an Azure Batch account for large-scale parallel computing.

Link

Cognitive Services1

az cognitiveservices account create

Creates a Cognitive Services account.

Link

SignalR1

az signalr create

Creates a SignalR Service for real-time web functionality.

Link

Redis Cache1

az redis create

Creates a Redis Cache instance.

Link

Private Networking3

az network private-endpoint create

Creates a private endpoint to securely connect to PaaS services.

Link
az network private-dns zone create

Creates a private DNS zone for resolving private endpoint IPs.

Link
az network private-dns link vnet create

Links a private DNS zone to a virtual network.

Link

CDN1

az cdn profile create

Creates a Content Delivery Network profile.

Link

Service Bus2

az servicebus namespace create

Creates a Service Bus namespace for enterprise messaging.

Link
az servicebus queue create

Creates a queue within a Service Bus namespace.

Link

Kusto (Data Explorer)1

az kusto cluster create

Creates an Azure Data Explorer cluster.

Link

Bot Service1

az bot create

Creates a Bot Service registration.

Link

Blueprint1

az blueprint create

Creates a blueprint definition for governance.

Link

Synapse Analytics1

az synapse workspace create

Creates a Synapse Analytics workspace.

Link

Advanced Security (Defender)1

az security pricing list

Lists the pricing tiers for Microsoft Defender for Cloud bundles.

Link

Recovery Services2

az backup vault create

Creates a Recovery Services vault for backups.

Link
az backup protection enable-for-vm

Enables backup for a virtual machine.

Link

Blue Team (Subscriptions)1

az account management-group list

Lists management groups to understand the organization hierarchy.

Link

Cleanup5

az resource delete

Deletes a specific resource by its ID.

Link
az group delete

Deletes a resource group and all contained resources asynchronously.

Link
az ad app delete

Deletes an application registration from Azure AD.

Link
az keyvault delete

Deletes a Key Vault (moves to soft-deleted state).

Link
az keyvault purge

Permanently purges a soft-deleted Key Vault.

Link

Azure Functions (Serverless)2

az functionapp create

Boots dynamic isolated serverless algorithmic workers bridging AppService endpoints natively.

Link
az functionapp keys list

Exfiltrates the mandatory authorization connection strings fundamentally required to execute an HTTP-bound function.

Link

Cosmos DB2

az cosmosdb database create

Instantiates globally replicated logic cores strictly optimized for massive globally asynchronous operations.

Link
az cosmosdb keys list

Decrypts and reveals the raw Read/Write master cryptographic passcodes governing universal database interconnectivity.

Link

Container Registry (ACR)2

az acr login

Injects native Azure AAD authentication logic directly into your local Docker daemon enabling immediate secure push/pull workflows.

Link
az acr repository delete

Surgically excises compromised or bloated legacy Docker blobs natively restoring Azure bandwidth limits.

Link

Key Vault (Security)2

az keyvault secret set

Ingests raw unencrypted values encrypting them irreversibly within Azure's HSM arrays locking them onto specific app configurations.

Link
az keyvault secret show

Decrypts explicitly requested secured strings into plaintext, dropping outputs strictly to the local CLI.

Link