Explore Courses Blog Tutorials Interview Questions
+4 votes
in Azure by (1.4k points)

Can we get the Tenant ID of the azure active directory without using powershell command?

These two blogs helped me to solve my problem but is there any other way using which we can retrieve the ID

2 Answers

+11 votes
by (10.5k points)

Follow the steps:

1.Login into the Azure portal

2. Go to active directory and select the directory of your requirement

3. Select the application and then configure it using configure option

4. Copy the information and paste it onto the Service Principal form on the ServiceNow instance

5. Collect Client ID and Tenant ID, now copy the Client ID into the text file

6. Collect the Tenant ID. It is in the form of a GUID.

0 votes
by (40.7k points)

In the Azure CLI, you can use GNU/Linux):

$ azure login  # add "-e AzureChinaCloud" if you're using Azure China

This will ask you to log in via or

$ azure account show

info:    Executing command account show

data:    Name                        : BizSpark Plus

data:    ID                          : aZZZZZZZ-YYYY-HHHH-GGGG-abcdef569123

data:    State                       : Enabled

data:    Tenant ID                   : 0XXXXXXX-YYYY-HHHH-GGGG-123456789123

data:    Is Default                  : true

data:    Environment                 : AzureCloud

data:    Has Certificate             : No

data:    Has Access Token            : Yes

data:    User name                   : [email protected]


info:    account show command OK

Are you interested in learning Azure from basics! Refer to this video on Azure provided by Intellipaat:

Or else, you can do this:

azure account show --json | jq -r '.[0].tenantId'

Or you can use the new az:

az account show --subscription a... | jq -r '.tenantId'

az account list | jq -r '.[].tenantId'

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.5k answers


108k users

Browse Categories