In this Azure PowerShell article, we will discuss how to get tenant ID in Azure using PowerShell, Azure CLI, and Azure Portal.
Table of Contents
How to get tenant ID in Azure using PowerShell
Finding tenant ID in Azure using PowerShell using the below Azure PowerShell cmdlet is pretty simple.
Connect-AzAccount
Get-AzTenant
After executing the Azure PowerShell cmdlet, I got the below expected output.
PS C:\WINDOWS\system32> Connect-AzAccount
Get-AzTenant
Account SubscriptionName TenantId
------- ---------------- --------
fewlines4biju@hotmail.com Visual Studio Enterprise xxxxxxxx-0310-xxxx-xxxb-xxxxxxxx...
Id : xxxxxxxx-0310-xxxd-xxxb-xxxxxxxxxxxx
TenantId : xxxxxxxx-0310-xxxd-xxxb-xxxxxxxxxxxx
ExtendedProperties : {[Directory, hotmail.com], [DisplayName, Default Directory],
[TenantCategory, Home], [TenantType, AAD]...}
TenantCategory : Home
Country :
CountryCode : IN
Name : Default Directory
Domains : {fewlines4bijuhotmail.onmicrosoft.com}
DefaultDomain : fewlines4bijuhotmail.onmicrosoft.com
TenantType : AAD
TenantBrandingLogoUrl :
The screenshot below shows that I have executed the above command and got the expected output as the tenant’s details.

How to get tenant ID in Azure using Azure CLI
You can also find the tenant ID using Azure CLI by executing the cmdlet below.
az login
az account list
az account tenant list
After executing the above Azure CLI cmdlet, I got the below output.
{
"cloudName": "AzureCloud",
"homeTenantId": "xxxxxxxx-0310-xxxd-xxxb-xxxxxxxxxxxx",
"id": "1gh4300-dee5-4518-5c5c-feaa72a6ghj1",
"isDefault": true,
"managedByTenants": [],
"name": "Visual Studio Enterprise",
"state": "Enabled",
"tenantId": "xxxxxxxx-0310-xxxd-xxxb-xxxxxxxxxxxx",
"user": {
"name": "fewlines4biju@hotmail.com",
"type": "user"
}
You can see it here

How to find tenant ID in Azure Portal
Apart from using Azure PowerShell and Azure CLI, you can quickly get the tenant ID in Azure Portal by following the instructions below.
- Log in to Azure Portal.
- Search for Azure Active Directory and then click on the search result Azure Active Directory.

3. On the Azure Active Directory window, Scroll a bit down and click on the properties link from the left navigation. You can able to view the tenant ID under the Tenant properties as shown below.

You may also like following the articles below
Final Words
In this article, we discussed how to find tenant ID in Azure using PowerShell, Azure CLI, and Azure Portal. Now it’s your turn to decide which method best suits you.

I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, 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.