How to Determine your Microsoft Entra ID Tenant ID?

by | Mar 15, 2024 | Azure

This is one of those things that you need every once and a while but never seems to be at hand when you need it. You gloss over Microsoft Entra id tenant id every time you see it until you actually need it, then you can “never” find it. I always love when I search for how to and find my own stuff. This is what I hope will happen the next time I look for it.

Why do you need your Microsoft Entra ID Tenant ID?

This is a great question and, in my case, I need it for a Power BI reports. Where I will be querying MS graph directly from Power BI using Application ID Secrets. You will also want it for PowerShell too, when working with it.

Entra ID vs Azure AD

As I’m writing this, it is obvious to me that when I talk about Entra ID, it was previously called Azure AD. But while talk to a fried it was not. You will see this a lot within the docs and PowerShell command, they Azure AD is still used? Why they don’t have alias within PowerShell for every command yet, I will never know. Just keep this in mind when you are reviewing screenshots, docs, PowerShell or other resources, the two are synonymous.

How to Determine your Tenant ID?

portal.azure.com

Start by logon to your https://portal.azure.com/. Now in my case it is on the home screen but it isn’t always the case. It if exist then click it. if not, then click the menu icon it the top left.

Azure Menu

Again, Microsoft Entra ID will likely be in the menu, if so, click it. If not select All services.

All Services filter on Entra

In the filter textbox enter Entra. From there you will find the Microsoft Entra ID click it.

TenantId displayed.

Your Tenant ID is listed there in the middle of the screen (purple arrow). I have of course blurred out my Tenant ID. You can then use the copy button to put it within your clipboard. In my case, using Graph with Power BI.

How to Determine your Tenant ID via PowerShell?

So there are many time that you will need your Tenant ID within PowerShell too. I thought that I would document that too.

Installing Azure PowerShell module

Start by opening PowerShell, in my case I will use Visual Code to access PowerShell. Then install the module called Microsoft Azure PowerShell. Use the command Install-Module -Name Az

Connect-AzAccount

Next you need to connect to Entra ID, use the Connect-AzAccount command.

Logon to Azure

Login

Results of Connect-AzAccount with the Microsoft Entra ID Tenant ID

Notice that now that you are connected you can see the TenantId.

Results of Get-AZTenant showing the Microsoft Entra ID Tenant ID

To reenforce that use the Get-AZTenant command. Again, I have blurred out the TenantId.

How to Determine your Microsoft Entra ID Tenant ID video

Here are the steps that I took to determine my Microsoft Entra ID Tenant ID.

And finally, don’t forget that you can customizing the azure portal home page!

Hopefully you found this useful and you too can use this within your projects. If you have any questions about How to Determine your Microsoft Entra ID Tenant ID. Please feel free to contact me @GarthMJ Please also subscribe to my YouTube channel and newsletter.