
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Restart Azure VM Using Azure CLI in PowerShell
To restart the Azure VM using PowerShell, we can use the az vm restart command. This command requires the Azure VM in the running status. You also require to connect to the Azure cloud account and the proper azure subscription before running this command.
Let assume our VM win2k16vm1 is currently on. We need to restart this VM. Here, -n is the VM name, and -g is the resource group name.
PS C:\> az vm restart -n vmname -g RGname --verbose
You can also provide the full parameter name as shown below.
PS C:\> az vm restart --name win2k16vm1 --resource-group testvmrg
If the VM is unresponsive, you can restart it by using the --force parameter.
PS C:\> az vm restart --name win2k16vm1 --resource-group testvmrg --force
To restart the VM without waiting for long-running operations to finish, you can use the --no-wait parameter.
PS C:\> az vm restart --name win2k16vm1 --resource-group testvmrg --no-wait
Advertisements