Open In App

Microsoft Azure – Manage Azure VMs using Azure PowerShell Commands

Improve
Improve
Like Article
Like
Save
Share
Report

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:


Last Updated : 31 Mar, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads