Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Microsoft Azure – Azure CLI Commands to Manage Azure VMs

  • Last Updated : 20 Jan, 2022

Azure Command-line interface is used to manage or to create Azure resources. By using the simple AZ CLI command we can manage Azure VM quickly and at a Scale.

Let’s get started by using a few important Azure CLI commands to manage Azure Virtual Machines.

1.  Start a Specific Stopped VM in a Select Resource Group

Use the below command to start a specific VM in a select Resource group that has been stopped:

az vm start --resource-group 'resource_group_name --name vm_name

Example:

az vm start --resource-group Cloud-Operations --name CloudOpsVM

Output:

Output Image 2:

 2.  Stop a Specific Running VM in a Select Resource Group

Use the below command to stop a running VM in a select Resource group:

az vm stop --resource-group 'resource_group_name --name vm_name

Example:

az vm stop --resource-group Cloud-Operations --name CloudOpsVM

Output:

3.  Deallocate a Specific VM in a Select Resource Group

Use the below command to deallocate a specific VM in a select Resource group:

az vm deallocate --resource-group 'resource_group_name --name vm_name

Example:

az vm deallocate --resource-group Cloud-Operations --name CloudOpsVM

Output:

Output Image 2:

4. Restart a Specific Select VM in a Select Resource Group

Use the below command to restart  a specific VM in a select Resource group:

 az vm restart --resource-group 'resource_group_name --name vm_name

Example:

 az vm restart --resource-group Cloud-Operations --name CloudOpsVM

Output:

Output Image 2:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!