
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
List Azure VMs Using Azure CLI in PowerShell
To list all the Azure VMs connected to the particular subscription, we need to use the “Az vm” command. Before that, we need to make sure the Azure is connected to the desired subscription, if not use the below command to set the Azure Subscription.
az account set -s 'subscription name or id'
Once the Azure subscription is set, we can use the below command to retrieve the Azure VMs.
PS C:\> az vm list -otable
To get the particular azure VM using CLI, we need to provide the VM name and resource group name.
PS C:\> az vm show -n VmName -g ResourceGroupName -otable
“az vm show” command finds the VM from the list using parameter -n (VMName) -g (resource group Name).
Advertisements