Azure Active Directory Tenant ID

Introduction

As we all know, Azure Active Directory is a cloud-based Identity and Access management service which provides internal and external access to the resources. Azure Active Directory tenant id is required while authenticating service principal.

Search Azure Active Directory Tenant ID

There are multiple ways to find an azure active directory tenant id.

1) Using Azure Portal

Go to Azure Active Directory -> Properties -> Scroll Down to Tenant Id property

2) Power shell

Connect-AzAccount
Get-AzTenant

Here, the Connect-AzAccount command will connect to your azure account.

The get-AzTenant command will fetch all the information about the azure ad tenant.

This command will retrieve the tenant id of the Azure Active Directory.

3) Azure CLI

az login
az account list
az account tenant list

This command will list the tenant id.

Here, the az login command will log into the azure account.

az account list will list all the accounts associated with the user and the az account tenant list will list all tenants associated with the specific account.

Conclusion

We can use Azure Portal, Azure Powershell, and Azure CLI to get the tenant of the Azure Active Directory. If you want to manually fetch the Azure AD tenant id you can use Azure Portal. We can use Azure CLI or Azure Powershell to fetch Azure Active Directory Tenant Id.

Next Recommended Reading How to Get Access Token Using Azure CLI