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-AzTenantAfter 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 listAfter 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

Check out Where To Find Tenant ID In Azure Portal
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.
You may also like following the articles below

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.
