- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to list the 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).
- Related Articles
- How to list the azure VM extensions using Azure CLI in PowerShell?
- How to retrieve Azure VMs using PowerShell?
- How to Export the Azure VMs using PowerShell?
- How to deallocate the Azure VM using Azure CLI in PowerShell?
- How to start the Azure VM using Azure CLI in PowerShell?
- How to stop the Azure VM using Azure CLI in PowerShell?
- How to restart the Azure VM using Azure CLI in PowerShell?
- How to resize the Azure VM using Azure CLI in PowerShell?
- How to connect to the Azure subscription using Azure CLI in PowerShell?
- How to list the Azure VMs from the Availability set using PowerShell?
- How to get the Azure resource group using Azure CLI in PowerShell?
- How to get the Azure VM Size using Azure CLI in PowerShell?
- How to get the Azure VM username using Azure CLI in PowerShell?
- How to delete the azure blob (File) using Azure CLI in PowerShell?
- How to retrieve the Azure VM nic name using Azure CLI in PowerShell?

Advertisements