How to get Client ID, Tenant ID and Client Secret in Microsoft Azure

To create a client ID, tenant ID, and client secret in Microsoft Azure, you need to register an application in Microsoft Entra ID (formerly Azure Active Directory).

PrerequisitesYou must have an Azure account with permissions to register applications in the Microsoft Entra tenant.

Step 1: Find your Tenant ID

  1. Sign in to the Azure portal.

  2. In the search bar, type "Microsoft Entra ID" and select the service from the results.

  3. On the Overview page, find the Directory (tenant) ID.

  4. Copy this ID and save it in a secure location.

Step 2: Create an App Registration (Client ID)

  1. In the Microsoft Entra ID menu, select App registrations under the "Manage" section.

  2. Select + New registration.

  3. On the "Register an application" page:

    • Enter a meaningful Name for the application (e.g., "MyTestApp").

    • Under Supported account types, select an option based on your needs (e.g., "Accounts in this organizational directory only" is recommended for most applications).

  4. Select Register.

  5. After the app is created, you will be on its Overview page. Find and copy the Application (client) ID. This is your client ID.

  6. Save the client ID in a secure location.

Step 3: Generate the Client Secret

  1. From your app registration's left-hand menu, under "Manage", select Certificates & secrets.

  2. Under the Client secrets section, select + New client secret.

  3. A dialog box will appear:

    • Provide a Description for the secret.

    • Select a duration for when the secret will Expire. Microsoft recommends choosing one year for easier tracking.

  4. Select Add.

  5. Important: The Value of the client secret is displayed only this one time. Be sure to copy the value immediately and save it in a secure location. You cannot retrieve it later. The Secret ID is not the value you need for authentication.

You have now successfully obtained your tenant ID, client ID, and client secret, which are used to authenticate your application with Microsoft Entra ID

Last updated