Certainly! Here is a comprehensive list of Azure CLI commands, organized by their functionality.
-
Login to Azure:
az login
-
Log out of Azure:
az logout
-
List available subscriptions:
az account list
-
Set a specific subscription:
az account set --subscription "Subscription Name or ID"
-
Get the current subscription:
az account show
-
Get Azure CLI version:
az --version
-
List all virtual machines:
az vm list --output table
-
Create a new virtual machine:
az vm create --resource-group MyResourceGroup --name MyVM --image UbuntuLTS --admin-username azureuser --generate-ssh-keys
-
Start a virtual machine:
az vm start --resource-group MyResourceGroup --name MyVM
-
Stop a virtual machine:
az vm stop --resource-group MyResourceGroup --name MyVM
-
Delete a virtual machine:
az vm delete --resource-group MyResourceGroup --name MyVM --yes --no-wait
-
List all VM sizes:
az vm list-sizes --location eastus
-
List all storage accounts:
az storage account list --output table
-
Create a new storage account:
az storage account create --name mystorageaccount --resource-group MyResourceGroup --location eastus --sku Standard_LRS
-
Delete a storage account:
az storage account delete --name mystorageaccount --resource-group MyResourceGroup --yes
-
List containers in a storage account:
az storage container list --account-name mystorageaccount --output table
-
Create a new container:
az storage container create --name mycontainer --account-name mystorageaccount
-
Delete a container:
az storage container delete --name mycontainer --account-name mystorageaccount
-
List all virtual networks:
az network vnet list --output table
-
Create a new virtual network:
az network vnet create --resource-group MyResourceGroup --name MyVNet --address-prefix 10.0.0.0/16
-
Delete a virtual network:
az network vnet delete --resource-group MyResourceGroup --name MyVNet
-
List all network security groups:
az network nsg list --output table
-
Create a new network security group:
az network nsg create --resource-group MyResourceGroup --name MyNSG
-
Delete a network security group:
az network nsg delete --resource-group MyResourceGroup --name MyNSG
-
List all resource groups:
az group list --output table
-
Create a new resource group:
az group create --name MyResourceGroup --location eastus
-
Delete a resource group:
az group delete --name MyResourceGroup --yes --no-wait
-
List all SQL servers:
az sql server list --output table
-
Create a new SQL server:
az sql server create --name myserver --resource-group MyResourceGroup --location eastus --admin-user myadmin --admin-password mypassword
-
Delete a SQL server:
az sql server delete --name myserver --resource-group MyResourceGroup --yes
-
List all databases in a server:
az sql db list --server myserver --resource-group MyResourceGroup --output table
-
Create a new database:
az sql db create --resource-group MyResourceGroup --server myserver --name mydatabase --service-objective S0
-
Delete a database:
az sql db delete --resource-group MyResourceGroup --server myserver --name mydatabase --yes
-
List all app services:
az webapp list --output table
-
Create a new app service:
az webapp create --resource-group MyResourceGroup --plan MyAppServicePlan --name MyWebApp --runtime "NODE|14-lts"
-
Delete an app service:
az webapp delete --resource-group MyResourceGroup --name MyWebApp
-
List all app service plans:
az appservice plan list --output table
-
Create a new app service plan:
az appservice plan create --name MyAppServicePlan --resource-group MyResourceGroup --sku B1
-
Delete an app service plan:
az appservice plan delete --name MyAppServicePlan --resource-group MyResourceGroup --yes
-
List all key vaults:
az keyvault list --output table
-
Create a new key vault:
az keyvault create --name MyKeyVault --resource-group MyResourceGroup --location eastus
-
Delete a key vault:
az keyvault delete --name MyKeyVault --resource-group MyResourceGroup
-
List secrets in a key vault:
az keyvault secret list --vault-name MyKeyVault --output table
-
Set a secret in a key vault:
az keyvault secret set --vault-name MyKeyVault --name MySecret --value "MySecretValue"
-
Get a secret from a key vault:
az keyvault secret show --vault-name MyKeyVault --name MySecret
-
List all Cosmos DB accounts:
az cosmosdb list --output table
-
Create a new Cosmos DB account:
az cosmosdb create --name MyCosmosDB --resource-group MyResourceGroup --kind MongoDB
-
Delete a Cosmos DB account:
az cosmosdb delete --name MyCosmosDB --resource-group MyResourceGroup --yes
-
List all Traffic Manager profiles:
az network traffic-manager profile list --output table
-
Create a new Traffic Manager profile:
az network traffic-manager profile create --name MyTrafficManager --resource-group MyResourceGroup --routing-method Priority --unique-dns-name mytrafficmanager
-
Delete a Traffic Manager profile:
az network traffic-manager profile delete --name MyTrafficManager --resource-group MyResourceGroup --yes
-
List all AKS clusters:
az aks list --output table
-
Create a new AKS cluster:
az aks create --resource-group MyResourceGroup --name MyAKSCluster --node-count 1 --enable-addons monitoring --generate-ssh-keys
-
Delete an AKS cluster:
az aks delete --resource-group MyResourceGroup --name MyAKSCluster --yes
-
Get AKS credentials:
az aks get-credentials --resource-group MyResourceGroup --name MyAKSCluster
This list includes a broad range of Azure CLI commands for managing various Azure resources and services. It should provide a solid foundation for interacting with Azure via the command line.