Let us learn the syntax and usage of the Az account list command with examples.
Table of Contents
Az account list
The Az account list Azure CLI cmdlet will help you retrieve the lists of all the accounts associated with that particular user.
Syntax of az account list
az account listAz account list Examples
Example-1
You can execute the below Azure CLI command to get the lists of all the accounts associated with a particular user.
az account listAfter executing the above command, I got the output below. Since I have only one account, it is showing only one.
[
{
"cloudName": "AzureCloud",
"homeTenantId": "5d9d690a-0310-474d-fghh-42df2d556789",
"id": "1cdf4300-dee5-4518-9c9c-tghrii5cbd1",
"isDefault": true,
"managedByTenants": [],
"name": "Visual Studio Enterprise",
"state": "Enabled",
"tenantId": "5d9d690a-0567-474d-ae8b-468575249228",
"user": {
"name": "fewlines4biju@hotmail.com",
"type": "user"
}
}
]You can see the same output in the screenshot below.

Example-2
You can use the below command to see the output in a table format.
az account list -o tableAfter executing the above command, I got the expected output in a table format, as shown in the below screenshot.

Example-3
You can execute the below command to list the supported locations for your current subscription.
az account list-locationsAfter executing the above command, I got the expected output, as shown in the screenshot below.

Check out Az account subscription list
Conclusion
Use the Az account list command to get the lists of all the accounts associated with the specified user. Here, we discussed the syntax and usage of the Az account list Azure CLI command. Thanks for reading this article !!!

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.
