Azure CLI Commands
1. az login
Answer:
Logs in to your Azure account.
Example:
`az login` will open a browser window to
authenticate your Azure credentials.
2. az account list
Answer:
Lists all subscriptions associated with
your Azure account.
Example:
`az account list --output table` will
display subscriptions in a table format.
3. az group create
Answer:
Creates a new resource group in a specific
location.
Example:
`az group create --name MyResourceGroup
--location eastus` will create a resource group named 'MyResourceGroup' in the
'East US' region.
4. az vm create
Answer:
Creates a new virtual machine.
Example:
`az vm create --resource-group
MyResourceGroup --name MyVM --image UbuntuLTS --admin-username azureuser
--generate-ssh-keys` will create a VM with an Ubuntu image.
5. az vm start
Answer:
Starts a stopped virtual machine.
Example:
`az vm start --resource-group
MyResourceGroup --name MyVM` will start the 'MyVM' VM in the specified resource
group.
6. az vm stop
Answer:
Stops a running virtual machine.
Example:
`az vm stop --resource-group
MyResourceGroup --name MyVM` will stop the 'MyVM' VM.
7. az vm delete
Answer:
Deletes a virtual machine.
Example:
`az vm delete --resource-group
MyResourceGroup --name MyVM --yes --no-wait` will delete the 'MyVM' VM without
prompting for confirmation.
8. az storage account create
Answer:
Creates a new Azure Storage account.
Example:
`az storage account create --name
mystorageaccount --resource-group MyResourceGroup --location eastus --sku
Standard_LRS` creates a storage account with the specified name and properties.
9. az storage blob upload
Answer:
Uploads a file to a blob storage container.
Example:
`az storage blob upload --account-name
mystorageaccount --container-name mycontainer --name myblob --file
/path/to/file` uploads the file to the container.
10. az network vnet create
Answer:
Creates a new virtual network.
Example:
`az network vnet create --name MyVNet
--resource-group MyResourceGroup --subnet-name MySubnet` creates a virtual
network named 'MyVNet' with a subnet 'MySubnet'.
11. az network nsg create
Answer:
Creates a new Network Security Group (NSG).
Example:
`az network nsg create --name MyNSG
--resource-group MyResourceGroup` creates a new NSG in the specified resource
group.
12. az appservice plan create
Answer:
Creates a new App Service plan.
Example:
`az appservice plan create --name
MyAppServicePlan --resource-group MyResourceGroup --sku B1 --is-linux` creates
a Linux-based App Service plan in the 'MyResourceGroup' resource group.
13. az webapp create
Answer:
Creates a new Azure Web App.
Example:
`az webapp create --resource-group
MyResourceGroup --plan MyAppServicePlan --name MyWebApp` creates a web app
named 'MyWebApp' using the specified app service plan.
14. az monitor metrics list
Answer:
Lists the metrics for a specific resource.
Example:
`az monitor metrics list --resource
/subscriptions/{subscription-id}/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVM`
will show the metrics for a specific VM.
15. az ad user create
Answer:
Creates a new user in Azure Active
Directory.
Example:
`az ad user create --display-name
JohnDoe --user-principal-name john.doe@example.com --password MyP@ssword123`
will create a user named John Doe.
16. az functionapp create
Answer:
Creates a new Azure Function App.
Example:
`az functionapp create --name
MyFunctionApp --resource-group MyResourceGroup --plan MyAppServicePlan
--runtime node` creates a function app running Node.js.
17. az sql server create
Answer:
Creates a new SQL server.
Example:
`az sql server create --name MySqlServer
--resource-group MyResourceGroup --location eastus --admin-user adminuser
--admin-password MyP@ssword123` creates a SQL server with the specified admin
credentials.
18. az kubernetes cluster create
Answer:
Creates a new Azure Kubernetes Service
(AKS) cluster.
Example:
`az aks create --resource-group
MyResourceGroup --name MyAKSCluster --node-count 3 --enable-addons monitoring`
creates an AKS cluster with 3 nodes.
19. az vm list
Answer:
Lists all virtual machines in a
subscription.
Example:
`az vm list --output table` lists VMs in
a tabular format.
20. az container create
Answer:
Creates a new container instance in Azure.
Example:
`az container create --resource-group
MyResourceGroup --name MyContainer --image nginx` creates a container instance
using the nginx image.
21. az container logs
Answer:
Fetches the logs of a container instance.
Example:
`az container logs --resource-group
MyResourceGroup --name MyContainer` retrieves the logs from the specified
container.
22. az cosmosdb create
Answer:
Creates a new Azure Cosmos DB account.
Example:
`az cosmosdb create --name
MyCosmosDBAccount --resource-group MyResourceGroup --kind GlobalDocumentDB`
creates a Cosmos DB account for document storage.
23. az cosmosdb sql database create
Answer:
Creates a SQL database within a Cosmos DB
account.
Example:
`az cosmosdb sql database create
--account-name MyCosmosDBAccount --name MyDatabase --resource-group
MyResourceGroup` creates a new SQL database.
24. az sql db create
Answer:
Creates a new database within an existing
SQL server.
Example:
`az sql db create --name MyDatabase
--resource-group MyResourceGroup --server MySqlServer --edition Basic` creates
a new database with Basic pricing tier.
25. az sql server update
Answer:
Updates an existing SQL server's
properties.
Example:
`az sql server update --name MySqlServer
--resource-group MyResourceGroup --set tags.Department=HR` updates the server
with a new tag.
26. az network vnet delete
Answer:
Deletes a virtual network.
Example:
`az network vnet delete --name MyVNet
--resource-group MyResourceGroup --yes` deletes the virtual network 'MyVNet'.
27. az keyvault create
Answer:
Creates a new Azure Key Vault.
Example:
`az keyvault create --name MyKeyVault
--resource-group MyResourceGroup --location eastus` creates a Key Vault in the
East US region.
28. az keyvault secret set
Answer:
Stores a secret in Azure Key Vault.
Example:
`az keyvault secret set --vault-name
MyKeyVault --name MySecret --value 'MySecretValue'` stores a secret value in
the vault.
29. az keyvault secret show
Answer:
Retrieves a stored secret from Azure Key
Vault.
Example:
`az keyvault secret show --vault-name
MyKeyVault --name MySecret` retrieves the secret value from Key Vault.
30. az functionapp plan update
Answer:
Updates an existing function app plan.
Example:
`az functionapp plan update --name
MyAppServicePlan --resource-group MyResourceGroup --sku S1` updates the plan's
SKU to Standard S1.
31. az network public-ip create
Answer:
Creates a new public IP address.
Example:
`az network public-ip create
--resource-group MyResourceGroup --name MyPublicIP` creates a new public IP for
your resource.
32. az storage account update
Answer:
Updates the settings of a storage account.
Example:
`az storage account update --name
mystorageaccount --resource-group MyResourceGroup --set
allowBlobPublicAccess=false` updates the storage account to disallow public
access.
33. az appservice plan delete
Answer:
Deletes an existing App Service plan.
Example:
`az appservice plan delete --name
MyAppServicePlan --resource-group MyResourceGroup --yes` deletes the App
Service plan.
34. az resource delete
Answer:
Deletes a specific Azure resource.
Example:
`az resource delete --ids
/subscriptions/{subscription-id}/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVM`
deletes the specified VM resource.
35. az ad app create
Answer:
Creates a new Azure Active Directory
application.
Example:
`az ad app create --display-name MyApp
--identifier-uris http://myapp --password MyP@ssword123` creates a new
application with specified credentials.
36. az aks get-credentials
Answer:
Gets the Kubernetes cluster credentials for
Azure Kubernetes Service.
Example:
`az aks get-credentials --resource-group
MyResourceGroup --name MyAKSCluster` retrieves the kubeconfig file for
accessing the AKS cluster.
37. az aks scale
Answer:
Scales an Azure Kubernetes Service (AKS)
cluster.
Example:
`az aks scale --resource-group
MyResourceGroup --name MyAKSCluster --node-count 5` scales the AKS cluster to 5
nodes.
38. az monitor activity-log list
Answer:
Lists activity log entries for your Azure
resources.
Example:
`az monitor activity-log list
--resource-group MyResourceGroup --output table` retrieves the activity log in
a table format.
39. az network firewall create
Answer:
Creates a new Azure Firewall.
Example:
`az network firewall create --name
MyFirewall --resource-group MyResourceGroup --location eastus` creates a
firewall in the specified resource group.
40. az monitor diagnostic-settings create
Answer:
Creates a diagnostic setting for a
resource.
Example:
`az monitor diagnostic-settings create
--resource
/subscriptions/{subscription-id}/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVM
--name MyDiagnosticSetting --logs` creates a diagnostic setting for logging VM
activity.
41. az storage container create
Answer:
Creates a storage container.
Example:
`az storage container create
--account-name mystorageaccount --name mycontainer` creates a new blob storage
container in your storage account.
42. az vm resize
Answer:
Resizes a virtual machine.
Example:
`az vm resize --resource-group
MyResourceGroup --name MyVM --size Standard_DS3_v2` resizes the 'MyVM' virtual
machine to the specified size.
43. az deployment group create
Answer:
Deploys a resource using an Azure Resource
Manager (ARM) template.
Example:
`az deployment group create
--resource-group MyResourceGroup --template-file template.json` deploys
resources based on the ARM template.
44. az network vpn gateway create
Answer:
Creates a new VPN Gateway.
Example:
`az network vpn gateway create --name
MyVpnGateway --resource-group MyResourceGroup --public-ip-address MyPublicIP
--sku VpnGw1` creates a new VPN gateway with the specified public IP.
45. az appservice plan create
Answer:
Creates a new App Service plan.
Example:
`az appservice plan create --name
MyAppServicePlan --resource-group MyResourceGroup --sku S1` creates an App
Service plan with the Standard S1 pricing tier.
46. az vm image list
Answer:
Lists available virtual machine images.
Example:
`az vm image list --offer Ubuntu --all`
lists all Ubuntu images available for creating a virtual machine.
47. az network lb rule create
Answer:
Creates a load balancer rule.
Example:
`az network lb rule create
--resource-group MyResourceGroup --lb-name MyLoadBalancer --name MyRule
--protocol Tcp --frontend-port 80 --backend-port 80 --frontend-ip-name
MyFrontendIp --backend-pool-name MyBackendPool` creates a load balancer rule.
48. az network public-ip update
Answer:
Updates a public IP address.
Example:
`az network public-ip update
--resource-group MyResourceGroup --name MyPublicIP --dns-name mypublicip`
updates the public IP to include a DNS name.
49. az eventgrid event-subscription create
Answer:
Creates an event subscription to receive
events.
Example:
`az eventgrid event-subscription create
--name MyEventSubscription --source-resource-id
/subscriptions/{subscription-id}/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount
--endpoint https://myendpoint.com` creates an event subscription for Azure
Storage events.
50. az ad group create
Answer:
Creates a new Azure Active Directory group.
Example:
`az ad group create --display-name
MyGroup --mail-nickname MyGroup --security` creates a new security group in
Azure AD.
51. az ad user create
Answer:
Creates a new Azure Active Directory user.
Example:
`az ad user create --display-name MyUser
--user-principal-name myuser@mydomain.com --password MyP@ssword123` creates a
new user in Azure AD.
52. az disk create
Answer:
Creates a new managed disk.
Example:
`az disk create --resource-group
MyResourceGroup --name MyDisk --size-gb 128 --sku Premium_LRS` creates a new
128 GB managed disk with Premium storage.
53. az disk delete
Answer:
Deletes a managed disk.
Example:
`az disk delete --resource-group
MyResourceGroup --name MyDisk --yes` deletes a disk named MyDisk in the
specified resource group.
54. az resource list
Answer:
Lists all resources in a subscription or
resource group.
Example:
`az resource list --resource-group
MyResourceGroup` lists all resources within the specified resource group.
55. az vm stop
Answer:
Stops a running virtual machine.
Example:
`az vm stop --resource-group
MyResourceGroup --name MyVM` stops the virtual machine named 'MyVM' in the
specified resource group.
56. az network nsg rule create
Answer:
Creates a new Network Security Group (NSG)
rule.
Example:
`az network nsg rule create
--resource-group MyResourceGroup --nsg-name MyNSG --name MyNSGRule --priority
100 --access Allow --direction Inbound --protocol Tcp --destination-port-range
80` creates a rule to allow inbound traffic on port 80.
57. az sql server firewall-rule create
Answer:
Creates a new firewall rule for a SQL
server.
Example:
`az sql server firewall-rule create
--resource-group MyResourceGroup --server MySqlServer --name MyFirewallRule
--start-ip-address 0.0.0.0 --end-ip-address 255.255.255.255` creates a rule
allowing access from any IP.
58. az resource move
Answer:
Moves resources to a new resource group or
subscription.
Example:
`az resource move --ids
/subscriptions/{subscription-id}/resourceGroups/MyResourceGroup
--destination-group NewResourceGroup` moves the resources from one resource
group to another.
59. az vm generalize
Answer:
Prepares a virtual machine for use as an
image.
Example:
`az vm generalize --resource-group
MyResourceGroup --name MyVM` generalizes a VM so it can be used as a custom
image.
60. az webapp up
Answer:
Quickly deploy a web app to Azure App
Service.
Example:
`az webapp up --name MyWebApp
--resource-group MyResourceGroup --location eastus` deploys a web app in the
East US region.
61. az functionapp create
Answer:
Creates a new Azure Function App.
Example:
`az functionapp create --name
MyFunctionApp --resource-group MyResourceGroup --plan MyAppServicePlan
--runtime node` creates a new function app using Node.js runtime.
62. az storage blob upload
Answer:
Uploads a file to an Azure blob storage
container.
Example:
`az storage blob upload --container-name
MyContainer --file /path/to/myfile.txt --name myfile.txt` uploads a file to a
blob container.
63. az container instance delete
Answer:
Deletes a container instance.
Example:
`az container instance delete --name
MyContainer --resource-group MyResourceGroup --yes` deletes a container
instance.
64. az ad sp create-for-rbac
Answer:
Creates a service principal for Azure
Role-Based Access Control (RBAC).
Example:
`az ad sp create-for-rbac --name
MyServicePrincipal` creates a service principal for managing resources.
65. az vm extension set
Answer:
Sets an extension on a virtual machine.
Example:
`az vm extension set --resource-group
MyResourceGroup --vm-name MyVM --name customScript --script-file ./script.sh`
applies a custom script extension to a VM.
66. az monitor metrics list
Answer:
Lists metrics for a resource.
Example:
`az monitor metrics list --resource
/subscriptions/{subscription-id}/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVM
--metric CPUUtilization` lists CPU utilization metrics for the specified VM.
67. az network vnet create
Answer:
Creates a virtual network (VNet) in Azure.
Example:
`az network vnet create --resource-group
MyResourceGroup --name MyVNet --address-prefix 10.0.0.0/16` creates a VNet with
the specified address space.
68. az network vnet subnet create
Answer:
Creates a subnet within a VNet.
Example:
`az network vnet subnet create
--resource-group MyResourceGroup --vnet-name MyVNet --name MySubnet
--address-prefix 10.0.1.0/24` creates a subnet with the specified address
space.
69. az storage account create
Answer:
Creates a storage account.
Example:
`az storage account create --name
mystorageaccount --resource-group MyResourceGroup --location eastus --sku
Standard_LRS` creates a storage account in the East US region.
70. az storage container create
Answer:
Creates a new storage container.
Example:
`az storage container create --name
mycontainer --account-name mystorageaccount` creates a container within the
specified storage account.
71. az sql db create
Answer:
Creates a new SQL database.
Example:
`az sql db create --resource-group
MyResourceGroup --server MySqlServer --name MyDatabase --sku S1` creates a new
database in the specified SQL server.
72. az vm resize
Answer:
Resizes a virtual machine.
Example:
`az vm resize --resource-group
MyResourceGroup --name MyVM --size Standard_DS2_v2` resizes the VM to a
Standard_DS2_v2 size.
73. az aks create
Answer:
Creates an Azure Kubernetes Service (AKS)
cluster.
Example:
`az aks create --resource-group
MyResourceGroup --name MyAKSCluster --node-count 3 --enable-addons monitoring
--generate-ssh-keys` creates a Kubernetes cluster with monitoring enabled.
74. az aks get-credentials
Answer:
Gets the credentials to connect to an AKS
cluster.
Example:
`az aks get-credentials --resource-group
MyResourceGroup --name MyAKSCluster` configures `kubectl` to access the
specified AKS cluster.
75. az aks scale
Answer:
Scales an AKS cluster.
Example:
`az aks scale --resource-group
MyResourceGroup --name MyAKSCluster --node-count 5` scales the AKS cluster to 5
nodes.
76. az monitor log-analytics workspace create
Answer:
Creates a Log Analytics workspace.
Example:
`az monitor log-analytics workspace
create --resource-group MyResourceGroup --workspace-name MyWorkspace` creates a
workspace for collecting logs.
77. az monitor log-analytics query
Answer:
Executes a query in a Log Analytics
workspace.
Example:
`az monitor log-analytics query
--workspace MyWorkspace --query 'AzureActivity | take 10'` retrieves the most
recent Azure activity logs.
78. az network private-link-resource list
Answer:
Lists private link resources for a
specified resource.
Example:
`az network private-link-resource list
--name MyResource` lists all private link resources associated with the given
resource.
79. az functionapp deployment source config-zip
Answer:
Deploys a ZIP file to an Azure Function
App.
Example:
`az functionapp deployment source
config-zip --resource-group MyResourceGroup --name MyFunctionApp --src
/path/to/function.zip` deploys the ZIP file to the specified Function App.
80. az cosmosdb create
Answer:
Creates a new Cosmos DB account.
Example:
`az cosmosdb create --resource-group
MyResourceGroup --name MyCosmosDBAccount --kind GlobalDocumentDB` creates a
Cosmos DB account for document-based storage.
81. az cosmosdb sql database create
Answer:
Creates a SQL database in Cosmos DB.
Example:
`az cosmosdb sql database create
--account-name MyCosmosDBAccount --name MySqlDatabase --resource-group
MyResourceGroup` creates a SQL database within a Cosmos DB account.
82. az keyvault create
Answer:
Creates an Azure Key Vault.
Example:
`az keyvault create --resource-group
MyResourceGroup --name MyKeyVault --location eastus` creates a Key Vault for
storing secrets and keys.
83. az keyvault secret set
Answer:
Sets a secret in an Azure Key Vault.
Example:
`az keyvault secret set --vault-name
MyKeyVault --name MySecret --value 'secret-value'` stores a secret in the Key
Vault.
84. az storage file upload
Answer:
Uploads a file to Azure Files.
Example:
`az storage file upload --share-name
MyShare --source /path/to/myfile.txt --path myfile.txt` uploads a file to an
Azure File Share.
85. az network application-gateway create
Answer:
Creates an application gateway.
Example:
`az network application-gateway create
--name MyAppGateway --resource-group MyResourceGroup --sku Standard_v2
--gateway-ip-configurations name=myAppGatewayConfig --frontend-ports port=80`
creates an application gateway with the specified configurations.
86. az network dns zone create
Answer:
Creates a DNS zone.
Example:
`az network dns zone create
--resource-group MyResourceGroup --name mydomain.com` creates a DNS zone for
the domain 'mydomain.com'.
87. az sql server firewall-rule delete
Answer:
Deletes a firewall rule for an SQL server.
Example:
`az sql server firewall-rule delete
--resource-group MyResourceGroup --server MySqlServer --name MyFirewallRule`
deletes the specified firewall rule from the SQL server.
88. az ad group delete
Answer:
Deletes an Azure AD group.
Example:
`az ad group delete --group MyGroup`
deletes the Azure AD group named 'MyGroup'.
89. az webapp create
Answer:
Creates a new web app in Azure.
Example:
`az webapp create --resource-group
MyResourceGroup --name MyWebApp --plan MyAppServicePlan` creates a new web app
in the specified resource group.
90. az webapp deployment source config-zip
Answer:
Deploys a ZIP file to an Azure Web App.
Example:
`az webapp deployment source config-zip
--resource-group MyResourceGroup --name MyWebApp --src /path/to/your-app.zip`
uploads and deploys a ZIP file to the web app.
91. az storage blob upload
Answer:
Uploads a blob to Azure Storage.
Example:
`az storage blob upload --container-name
MyContainer --file /path/to/local/file.txt --name blobname.txt` uploads the
file to the specified blob container.
92. az storage blob download
Answer:
Downloads a blob from Azure Storage.
Example:
`az storage blob download
--container-name MyContainer --name blobname.txt --file
/path/to/downloaded/file.txt` downloads the blob to a local file.
93. az sql db list
Answer:
Lists all SQL databases in a specified
server.
Example:
`az sql db list --resource-group
MyResourceGroup --server MySqlServer` lists the databases in the specified SQL
server.
94. az sql server firewall-rule create
Answer:
Creates a new firewall rule for an SQL
server.
Example:
`az sql server firewall-rule create
--resource-group MyResourceGroup --server MySqlServer --name MyFirewallRule
--start-ip-address 10.0.0.1 --end-ip-address 10.0.0.255` creates a firewall
rule allowing access from the specified IP range.
95. az vm start
Answer:
Starts a virtual machine.
Example:
`az vm start --resource-group
MyResourceGroup --name MyVM` starts the specified virtual machine.
96. az vm stop
Answer:
Stops a virtual machine.
Example:
`az vm stop --resource-group
MyResourceGroup --name MyVM` stops the specified virtual machine.
97. az vm deallocate
Answer:
Deallocates a virtual machine.
Example:
`az vm deallocate --resource-group
MyResourceGroup --name MyVM` releases the resources allocated to the specified
virtual machine.
98. az vm delete
Answer:
Deletes a virtual machine.
Example:
`az vm delete --resource-group
MyResourceGroup --name MyVM --yes` deletes the specified virtual machine
without confirmation.
99. az network public-ip create
Answer:
Creates a public IP address.
Example:
`az network public-ip create
--resource-group MyResourceGroup --name MyPublicIP --sku Standard` creates a
standard public IP address.
100. az network public-ip delete
Answer:
Deletes a public IP address.
Example:
`az network public-ip delete
--resource-group MyResourceGroup --name MyPublicIP` deletes the specified
public IP address.
101. az network application-gateway show
Answer:
Shows the details of an application
gateway.
Example:
`az network application-gateway show
--name MyAppGateway --resource-group MyResourceGroup` displays the details of
the specified application gateway.
102. az network nsg rule create
Answer:
Creates a network security group (NSG)
rule.
Example:
`az network nsg rule create
--resource-group MyResourceGroup --nsg-name MyNSG --name MyRule --priority 1000
--direction Inbound --access Allow --protocol Tcp --destination-port-ranges 80`
creates an inbound rule to allow HTTP traffic.
103. az network nsg rule delete
Answer:
Deletes a network security group (NSG)
rule.
Example:
`az network nsg rule delete
--resource-group MyResourceGroup --nsg-name MyNSG --name MyRule` deletes the
specified NSG rule.
104. az aks get-credentials
Answer:
Gets the credentials for accessing an Azure
Kubernetes Service (AKS) cluster.
Example:
`az aks get-credentials --resource-group
MyResourceGroup --name MyAKSCluster` configures kubectl to access the specified
AKS cluster.
105. az container create
Answer:
Creates a container instance in Azure.
Example:
`az container create --resource-group
MyResourceGroup --name MyContainerInstance --image myimage --cpu 1 --memory
1.5` creates a container with the specified CPU and memory settings.
106. az container list
Answer:
Lists container instances in a resource
group.
Example:
`az container list --resource-group
MyResourceGroup` lists all container instances in the specified resource group.
107. az container stop
Answer:
Stops a container instance.
Example:
`az container stop --resource-group
MyResourceGroup --name MyContainerInstance` stops the specified container
instance.
108. az container delete
Answer:
Deletes a container instance.
Example:
`az container delete --resource-group
MyResourceGroup --name MyContainerInstance` deletes the specified container
instance.
109. az vm run-command invoke
Answer:
Executes a command on a virtual machine.
Example:
`az vm run-command invoke
--resource-group MyResourceGroup --name MyVM --command-id RunShellScript
--scripts 'echo Hello World'` runs the specified shell script on the VM.
110. az functionapp function list
Answer:
Lists functions within a function app.
Example:
`az functionapp function list
--resource-group MyResourceGroup --name MyFunctionApp` lists all the functions
deployed within the specified function app.
111. az monitor activity-log list
Answer:
Lists activity logs for a subscription.
Example:
`az monitor activity-log list
--resource-group MyResourceGroup --start-time '2022-01-01' --end-time
'2022-12-31'` lists activity logs for the specified time range.
112. az aks upgrade
Answer:
Upgrades the version of an AKS cluster.
Example:
`az aks upgrade --resource-group
MyResourceGroup --name MyAKSCluster --k8s-version 1.20.5` upgrades the cluster
to the specified Kubernetes version.
113. az resource tag
Answer:
Tags an Azure resource.
Example:
`az resource tag --tags Department=HR
Environment=Prod --ids
/subscriptions/{subscription-id}/resourceGroups/MyResourceGroup` adds tags to
the specified resource.
114. az disk create
Answer:
Creates a managed disk.
Example:
`az disk create --resource-group
MyResourceGroup --name MyDisk --size-gb 128 --sku Standard_LRS` creates a new
managed disk with the specified size and SKU.
115. az disk delete
Answer:
Deletes a managed disk.
Example:
`az disk delete --resource-group
MyResourceGroup --name MyDisk --yes` deletes the specified managed disk.
116. az storage account create
Answer:
Creates a new storage account in Azure.
Example:
`az storage account create --name
mystorageaccount --resource-group MyResourceGroup --location eastus --sku
Standard_LRS` creates a new standard storage account in the specified region.
117. az storage account delete
Answer:
Deletes an Azure storage account.
Example:
`az storage account delete --name
mystorageaccount --resource-group MyResourceGroup --yes` deletes the specified
storage account.
118. az network vnet create
Answer:
Creates a new virtual network.
Example:
`az network vnet create --resource-group
MyResourceGroup --name MyVNet --subnet-name MySubnet` creates a virtual network
with the specified subnet.
119. az network vnet delete
Answer:
Deletes a virtual network.
Example:
`az network vnet delete --resource-group
MyResourceGroup --name MyVNet` deletes the specified virtual network.
120. az network nic create
Answer:
Creates a new network interface card (NIC).
Example:
`az network nic create --resource-group
MyResourceGroup --name MyNIC --vnet-name MyVNet --subnet MySubnet` creates a
NIC attached to the specified virtual network and subnet.
121. az network nic delete
Answer:
Deletes a network interface card (NIC).
Example:
`az network nic delete --resource-group
MyResourceGroup --name MyNIC` deletes the specified network interface card.
122. az network route-table create
Answer:
Creates a new route table.
Example:
`az network route-table create
--resource-group MyResourceGroup --name MyRouteTable` creates a new route table
in the specified resource group.
123. az network route-table delete
Answer:
Deletes a route table.
Example:
`az network route-table delete
--resource-group MyResourceGroup --name MyRouteTable` deletes the specified
route table.
124. az network lb create
Answer:
Creates a load balancer in Azure.
Example:
`az network lb create --resource-group
MyResourceGroup --name MyLoadBalancer --sku Standard --frontend-ip-name
MyFrontendIP --backend-pool-name MyBackendPool` creates a load balancer with a
frontend and backend pool.
125. az network lb delete
Answer:
Deletes a load balancer.
Example:
`az network lb delete --resource-group
MyResourceGroup --name MyLoadBalancer` deletes the specified load balancer.
126. az network application-gateway create
Answer:
Creates a new application gateway.
Example:
`az network application-gateway create
--resource-group MyResourceGroup --name MyAppGateway --sku Standard_V2
--capacity 2 --frontend-port 80 --backend-port 80` creates an application
gateway with the specified configuration.
127. az network application-gateway delete
Answer:
Deletes an application gateway.
Example:
`az network application-gateway delete
--resource-group MyResourceGroup --name MyAppGateway` deletes the specified
application gateway.
128. az ad user create
Answer:
Creates a new Azure Active Directory user.
Example:
`az ad user create --display-name 'John
Doe' --password 'MyP@ssw0rd' --user-principal-name johndoe@contoso.com` creates
a new user in Azure AD.
129. az ad user delete
Answer:
Deletes a user from Azure Active Directory.
Example:
`az ad user delete --id
johndoe@contoso.com` deletes the specified Azure AD user.
130. az ad app create
Answer:
Creates a new application in Azure Active
Directory.
Example:
`az ad app create --display-name 'MyApp'
--identifier-uris 'http://myapp'` creates a new app registration.
131. az ad app delete
Answer:
Deletes an application from Azure Active
Directory.
Example:
`az ad app delete --id
00000000-0000-0000-0000-000000000000` deletes the specified application from
Azure AD.
132. az ad group create
Answer:
Creates a new security group in Azure
Active Directory.
Example:
`az ad group create --display-name
'DevGroup' --mail-nickname 'DevGroup'` creates a new AD group.
133. az ad group delete
Answer:
Deletes a security group from Azure Active
Directory.
Example:
`az ad group delete --group DevGroup`
deletes the specified security group.
134. az network vnet peering create
Answer:
Creates a virtual network peering.
Example:
`az network vnet peering create
--resource-group MyResourceGroup --vnet-name MyVNet1 --name MyPeering
--remote-vnet MyVNet2 --allow-vnet-access` creates a peering between two
virtual networks.
135. az network vnet peering delete
Answer:
Deletes a virtual network peering.
Example:
`az network vnet peering delete
--resource-group MyResourceGroup --vnet-name MyVNet1 --name MyPeering` deletes
the specified virtual network peering.
136. az network dns zone create
Answer:
Creates a DNS zone.
Example:
`az network dns zone create
--resource-group MyResourceGroup --name mydomain.com` creates a new DNS zone.
137. az network dns zone delete
Answer:
Deletes a DNS zone.
Example:
`az network dns zone delete
--resource-group MyResourceGroup --name mydomain.com` deletes the specified DNS
zone.
138. az sql server create
Answer:
Creates a new SQL server in Azure.
Example:
`az sql server create --name MySqlServer
--resource-group MyResourceGroup --location eastus --admin-user adminuser
--admin-password P@ssw0rd!` creates a new SQL server.
139. az sql server delete
Answer:
Deletes a SQL server in Azure.
Example:
`az sql server delete --name MySqlServer
--resource-group MyResourceGroup --yes` deletes the specified SQL server.
140. az storage container create
Answer:
Creates a new blob storage container.
Example:
`az storage container create --name
MyContainer --account-name mystorageaccount` creates a new container in the
specified storage account.
141. az storage container delete
Answer:
Deletes a blob storage container.
Example:
`az storage container delete --name
MyContainer --account-name mystorageaccount` deletes the specified container.