Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Microsoft Azure – Manage Azure VMs using Azure PowerShell Commands

  • Last Updated : 20 Jan, 2022

Here we are using Azure PS Commands to manage azure resources from Azure Cloud Shell or by using Windows PowerShell. By using the simple AZ PS command we can manage Azure VM Quicks without any efforts of navigating in Azure Portal and at Scale. Let’s get started by using the major Azure PS commands to manage Azure Virtual Machine.

1. Start a Specific Azure VM in a Select Resource Group:

Use the below PowerShell command to start a specific Azure VM in a select Resource group:

Start-AzVM -ResourceGroupName "rg_name_here" -Name "vm_name_here"

Example:

Start-AzVM -ResourceGroupName "Cloud-Operations" -Name "CloudOpsVM"

Output:

2. Stop a Specific Azure VM in a Select Resource Group:

Use the below PowerShell command to stop a specific Azure VM in a select Resource group:

Stop-AzVM -ResourceGroupName "rg_name_here" -Name "vm_name_here"

Example:

Stop-AzVM -ResourceGroupName "Cloud-Operations" -Name "CloudOpsVM"

After entering the command type “Y” to continue to the operation.

Output:

3. Restart a Specific Azure VM in a Select Resource Group:

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

Restart-AzVM -ResourceGroupName "rg_name_here" -Name "vm_name_here"

Example:

Restart-AzVM -ResourceGroupName "Cloud-Operations" -Name "CloudOpsVM"

Output:

4. List Details of a Specific Azure VM in a Select Resource Group

Use the below PowerShell command to list details of a specific Azure VM in a select Resource group:

Get-AzVM -ResourceGroupName "rg_name_here" -Name "vm_name_here"

Example:

Get-AzVM -ResourceGroupName "Cloud-Operations" -Name "CloudOpsVM"

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!