This Azure CLI article will discuss the syntax and usage of the az vm list command and provide certain examples of how to use it.
Table of Contents
Az vm list
This command can help you to list the details of the Virtual Machines.
Syntax of az vm list
Below is the syntax of the az vm list command.
az vm listaz vm list [--resource-group]Az vm list Examples
You can execute the below Azure CLI command to get the details of the lists of all the VMs.
az vm listAfter executing the above command, I got the expected output as below.
PS /home/bijay> az vm list [
{
"additionalCapabilities": null,
"applicationProfile": null,
"availabilitySet": null,
"billingProfile": null,
"capacityReservation": null,
"diagnosticsProfile": null,
"etag": null,
"evictionPolicy": null,
"extendedLocation": null,
"extensionsTimeBudget": null,
"hardwareProfile": {
"vmSize": "Standard_DS1_v2",
"vmSizeProperties": null
},
"host": null,
"hostGroup": null,
"id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/DEMO789/providers/Microsoft.Compute/virtualMachines/APPLEVM",
"identity": null,
"instanceView": null,
"licenseType": null,
"location": "eastus",
"managedBy": null,
"name": "APPLEVM",
"networkProfile": {
"networkApiVersion": null,
"networkInterfaceConfigurations": null,
"networkInterfaces": [
{
"deleteOption": null,
"id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/Demo789/providers/Microsoft.Network/networkInterfaces/APPLEVMVMNic",
"primary": null,
"resourceGroup": "Demo789"
}
]
},
"osProfile": {
"adminPassword": null,
"adminUsername": "rajkishore",
"allowExtensionOperations": true,
"computerName": "APPLEVM",
"customData": null,
"linuxConfiguration": null,
"requireGuestProvisionSignal": true,
"secrets": [],
"windowsConfiguration": {
"additionalUnattendContent": null,
"enableAutomaticUpdates": true,
"enableVmAgentPlatformUpdates": false,
"patchSettings": {
"assessmentMode": "ImageDefault",
"automaticByPlatformSettings": null,
"enableHotpatching": null,
"patchMode": "AutomaticByOS"
},
"provisionVmAgent": true,
"timeZone": null,
"winRm": null
}
},
"plan": null,
"platformFaultDomain": null,
"priority": null,
"provisioningState": "Succeeded",
"proximityPlacementGroup": null,
"resourceGroup": "DEMO789",
"resources": null,
"scheduledEventsProfile": null,
"securityProfile": {
"encryptionAtHost": null,
"encryptionIdentity": null,
"proxyAgentSettings": null,
"securityType": "TrustedLaunch",
"uefiSettings": {
"secureBootEnabled": true,
"vTpmEnabled": true
}
},
"storageProfile": {
"dataDisks": [],
"diskControllerType": "SCSI",
"imageReference": {
"communityGalleryImageId": null,
"exactVersion": "14393.6796.240302",
"id": null,
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sharedGalleryImageId": null,
"sku": "2016-datacenter-gensecond",
"version": "latest"
},
"osDisk": {
"caching": "ReadWrite",
"createOption": "FromImage",
"deleteOption": "Detach",
"diffDiskSettings": null,
"diskSizeGb": 127,
"encryptionSettings": null,
"image": null,
"managedDisk": {
"diskEncryptionSet": null,
"id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/Demo789/providers/Microsoft.Compute/disks/APPLEVM_OsDisk_1_7dd794867dcf4a6b9995dcc8fe790b07",
"resourceGroup": "Demo789",
"securityProfile": null,
"storageAccountType": "Premium_LRS"
},
"name": "APPLEVM_OsDisk_1_7dd794867dcf4a6b9995dcc8fe790b07",
"osType": "Windows",
"vhd": null,
"writeAcceleratorEnabled": null
}
},
"tags": {},
"timeCreated": "2024-03-26T06:10:13.484740+00:00",
"type": "Microsoft.Compute/virtualMachines",
"userData": null,
"virtualMachineScaleSet": null,
"vmId": "2320c87e-2b8d-48d5-9b72-4d23590d32de",
"zones": null
}
]You can see the same output in the below screenshot.

You may also like following the articles below
Conclusion
This article discussed the syntax and usage of the Az vm list Azure CLI command with certain examples of how to use this command.

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
