How To Register An App In Azure Active Directory

In this article, I will share the steps to register an app in Azure Active Directory. We need a client ID, secret key and Tenant ID to generate the oAuth token for Graph API.

In this article, I would like to share the steps to register an app in the Azure Active Directory.

Purpose of app registration

  • It is used to integrate the application and service with Azure AD.
  • Using Azure App, we can generate the token to authenticate the application.
  • If we want to use the Azure AD capabilities, we must register the app.
  • After we register the app, we can get the “Client ID, Secret key”.

Steps to register the new application in Azure AD

Follow the below-listed steps to register the application.

Step 1

Log into the Azure portal using your Azure account.

URL - https://portal.azure.com/

Step 2

Select Azure Active Directory from the left navigation.
 
How To Register The App In Azure Active Directory 

Step 3

On the “Default directory” page, select the “App registrations” from the left panel, as shown below.
 
How To Register The App In Azure Active Directory 

Step 4

From App Registration pane, click NewApplication Registration option.
 
How To Register The App In Azure Active Directory 

Step 5

On the "Create" pane, type in the following information and then click the "Create" button.
 
FieldDescriptionSample
NameName for the new application. Type in the desired application name.GraphConnectorApp
Application typeLeave as Web app/APIWeb app/API
Sign in URLLogin URL. (To get the data from Graph API, we no need to provide the proper login URL. Just give office URL)https://office.com

How To Register The App In Azure Active Directory 

Step 6
 
Once the application is created, edit the manifest file and change the value of oauth2AllowImplicitFlow parameter to true. 

 Before How To Register The App In Azure Active Directory
 After How To Register The App In Azure Active Directory

Step 7
 
Save the changes first and then click X to close the pane. 
 
How To Register The App In Azure Active Directory 

Step 8 

Then, we need to add the permissions. From Registered App pane, click the "Settings" option.
 
How To Register The App In Azure Active Directory 

Step 9

From Settings pane, click the "Required Permissions" option.
 
How To Register The App In Azure Active Directory 

Step 10

Now, click on + Add, then choose the “Select API”.
 
How To Register The App In Azure Active Directory 
 
How To Register The App In Azure Active Directory 

I’ve planned to use the new app for Graph API so I’ve selected Microsoft Graph. As per your need, you can select a different API.

How To Register The App In Azure Active Directory 

Step 11

From the "Enable Access" pane, place a check in the checkbox in front of the following permissions from the Application Permissions and Delegated Permissions sections. Then, click the "Select" button.

Application Permissions

How To Register The App In Azure Active Directory 
 
How To Register The App In Azure Active Directory
 
How To Register The App In Azure Active Directory

Delegated Permissions

Save the permissions.

How To Register The App In Azure Active Directory 

Step 12

From Add API Access pane, verify the count of roles and scope. Then click the Done button.
 
How To Register The App In Azure Active Directory 

Step 13

On Required Permissions pane, click the "Grant Permissions" option.

Note: Only Azure directory admin is able to do this.

How To Register The App In Azure Active Directory 
 
How To Register The App In Azure Active Directory

Finally, you have granted permission to the Azure app.

How To Register The App In Azure Active Directory 

Generate Secret key

Step 1

From Azure Active Directory Admin Centre, open the created application and click Settings option.
 
Log into https://aad.portal.azure.com/ > Azure Active Directory > App Registrations > select the created application name 

Step 2

From Settings pane, click Keys option.
 
How To Register The App In Azure Active Directory 

Step 3

From Keys pane, type in the following information and then click the "Save" button.
 
FieldDescriptionExample
DescriptionName for the key. Type in a descriptive name.Secret Key
Expires OnSelect Never expire option.Never expire
ValueYou will get the key when you click on the save 

Step 4

From the Keys pane, copy the encoded key value. This key value cannot be retrieved after leaving this pane. This encoded key value is the Client Secret Key that will be a part of the authentication credential. 
 
How To Register The App In Azure Active Directory 

Then, close the key pane.

Steps to get the Tenant ID

Step 1

From Azure Active Directory Admin Center, navigate to the App Registrations pane.
 
Log into https://aad.portal.azure.com/ > Azure Active Directory > App Registrations  

Step 2

From App Registrations pane, click Endpoints option.
 
How To Register The App In Azure Active Directory 

Step 3

From Endpoints pane, click on the copy icon next to OAuth 2.0 Token Endpoint option and save the value.
 
How To Register The App In Azure Active Directory 

From the copied endpoint URL, copy the value between
microsoftonline.com/ ….and / oauth2/token. This is the Tenant ID that will be part of the authentication credential. 

Get the Client ID

Step 1

From Azure Active Directory Admin Center, open the created application and click Settings option.
 
Log into https://aad.portal.azure.com/ > Azure Active Directory > App Registrations > select the created application name .

Step 2

From Settings pane, copy the Application ID value. This is the Client ID that will be part of the authentication credential. 
 
How To Register The App In Azure Active Directory 

Summary

In this article, we have explored how to register an app in Azure active directory. We also saw that we need client ID, secret key and Tenant ID to generate the oAuth token for Graph API.

Happy learning.