What are Azure TenantId, ClientId (Application Id) and ObjectId?

Jiangong Sun
3 min readMar 23, 2022

--

There are some Identifiers you have to know when you are using Azure.

They are:

  • Tenant Id
  • Client Id (Application Id)
  • Object Id

Tenant ID

Tenant Id is the Azure Active Directory’s Global unique identifier (GUID).

You can access it through the path: Azure Portal > Azure Active Directory

An example:

Azure application settings

Client ID (Equals to Application ID)

This is the unique application ID of this application in your directory. You can use this application ID if you ever need help from Microsoft Support, or if you want to perform operations against this specific instance of the application using the Azure Active Directory Graph or PowerShell APIs.

You can find the applications registered in your Azure subscription by Azure AD => Enterprise applications => Application Name.

You can log in the Azure with ClientId and ClientSecret and use it to manage user rights, or send emails etc.

Install the following Nuget packages to be able to authenticate in Graph API as an application.

  • Microsoft.Identity.Client
  • Microsoft.Graph
  • Microsoft.Graph.Auth

Then you can create a graph service client to be able to manipulate a lot of things in Microsoft Graph API.

create graph service client

Object Id

This is the unique ID of the service principal object associated with this application. This ID can be useful when performing management operations against this application using PowerShell or other programmatic interfaces.

As you can see in the previous chapter, Application has an “Application ID” and an “Object ID”.

And an user also has an Object ID.

azure user object Id

You can use object IDs to retrieve all the roles assigned to an user in an application.

retrieve user roles in application

Now you have an idea about the different identifiers in Azure.

--

--

Jiangong Sun
Jiangong Sun

Written by Jiangong Sun

Senior .NET engineer, passionate about new technologies. www.sunjiangong.com

No responses yet