Creating the application Client ID and Client Secret from Microsoft Azure old portal - Part 2

This is the continuation of Creating the application Client ID and Client Secret from Microsoft Azure new portal - Part 1 which guides you to generate Client ID and Client Secret from the Microsoft Azure New portal. In this post we will guide you to generate Client ID and Client Secret from the Microsoft Azure Old portal.

People who use any of the portal, old or new, might face difficulties in generating the IDs due to changes in the UI from Microsoft in recent times. This post will guide you step by step to get your app registered and generate IDs.

Login to the Old Windows Azure portal

If you already have a user account in your Azure tenant, or if you signed in to the Azure portal with a Microsoft account and have never created or used Active directory application, follow the steps below:

  • Go to Active Directory tab on the left pane as shown in the image below.
    Active directory tab Active directory tab

  • Click on the New button and then browse to App Services -->Active Directory-->Directory-->Custom Create, as shown below.

  • Once you click on the Custom Create option a window appears with text boxes as shown below.
    add directory

  • Enter the fields with your required values for your organization and click on complete (or tick mark).

  • Once you enter all the details and select "OK" you will see a screen like below.
    Once you select Ok, the window appears to look like

  • Now, select/click the directory you have created here it is "Testname".

  • Go to Applications window.
    click on applications

  • Click on Add option present below, once you click you can see a window as shown below.

  • Select the first option i.e. Add an application my organization is developing as seen above.

  • Provide a suitable meaningful name for your application ,makes sure you select WEB APPLICATION AND/OR WEB API Ex: testapifordriver and click next ->

  • App properties should be entered, Enter SIGN-ON URL and APP ID URI (click on ? to get more info on these terms)

  • Once you finish with these steps you will be redirected to a page as shown below.

  • Once you are on this page go to Configure on the top of the page which looks like the image below.

  • Now in the page you can see CLIENT ID for your application, copy it to your clipboard / notepad which will be referred in future.

    For Example: The Client ID looks like:

    Client ID: bce43b27-e7ef-4f92-b2f7-ce673516e073

  • Scroll down the page to see Keys which will be your Client Secret.
    client secret1

  • Select 1 or 2 years depending on your requirement, which looks like below. Save the page to see the Key /Client Secret.

  • Once you save, the key will appear which is generated only once, copy the key /Client Secret to your Clipboard.

    For Example: The Client Secret looks like:

    Client Secret: 6zMnJe1XCYUQIJv4aPQHLu4fokcd6aOA/j9gMkJJ2Gc=

  • Now this Client ID and Client Secret will be used for your driver configurations or any other rest clients. After which you can exit the page.

Once the app is ready you have to provide rights for your application or else you will not have permissions to delete objects from your driver using this client ID and secret.

Follow the steps below to provide permissions to your app:

Providing rights to your Client ID / application via PowerShell

Open PowerShell as Administrator and run the following commands in the order mentioned below:

  1. Connect to the Office 365 Exchange Online service using the following command and provide your exchange login credentials:

    Note: If you don't get any error messages assume login is successful.

  • Run the following commands in Power Shell.Running the command below will list all the Client IDs in the Azure application. <AppPrincipalID> should be replaced with your Client ID:
    General Syntax: Get-MsolServicePrincipal | ft DisplayName, <AppPrincipalId> -AutoSize

    For Example: Get-MsolServicePrincipal | ft DisplayName, 8b523s82-09d3-464e-af4f-28c82923e0m1 -AutoSize
    General Syntax: $ClientIdWebApp = '<AppPrincipalId>'

    For Example: $ClientIdWebApp = '8b523s82-09d3-464e-af4f-28c82923e0m1'

  • Run the following command to assign the "Company Administrator" rights to your application (Client ID), copy the commands below:
    $webApp = Get-MsolServicePrincipal –AppPrincipalId $ClientIdWebApp Add-MsolRoleMember -RoleName "Company Administrator" -RoleMemberType ServicePrincipal -RoleMemberObjectId $webApp.ObjectID

Note: The Company Administrator role will give you complete rights to your application.


How To-Best Practice
Comment List