In this Azure CLI tutorial, we will discuss the Az account show command with examples.
Table of Contents
az account show
This is an excellent Azure command that can help you to check the details like tenantId, user name, type, environmentName, homeTenantId, id, state, etc., using the az account show cmdlet.
Syntax
az account showaz account show --output tableaz account show --subscription 'Your subscription name'Example-1: Get the output in the JSON format
Once you will run the above command. You will get the output in the JSON format as shown below
{
"environmentName": "AzureCloud",
"homeTenantId": "5d9d690a-0310-474d-ae8b-42df2d549228",
"id": "1cdf4300-dee5-cccc-9c9c-feaa72a5cbd1",
"isDefault": true,
"managedByTenants": [],
"name": "Visual Studio Enterprise",
"state": "Enabled",
"tenantId": "5d9d690a-cccc-474d-ae8b-ghyf2d549228",
"user": {
"name": "fewlines4biju@hotmail.com",
"type": "user"
}You can check out the same output in the screenshot below, where I ran the az account show command and got the expected output.

Example 2: Get the output in a tabular format
If you want to see the output in a table format, you can use the below cmdlet
az account show --output tableAfter executing the above command, I got the output as expected. You can check out the screenshot below.

Example 3: Get the details of the specified subscription
If you want to retrieve the account details based on the subscription name, use the below cmdlet. In this example, “Visual Studio Enterprise” is the subscription name.
az account show --subscription 'Visual Studio Enterprise'After executing the above command, I got the expected output as below. See the below screen shot.

Az account show – Video Tutorial
You may also like following the articles below
Wrapping Up
Well. in this article, we have discussed the AZ account show that can help you retrieve the connected user account details using Azure CLI.
I hope you have enjoyed 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.
