Finding client ID and client Secret
To find the client ID and secret of your Azure tenant, follow the steps listed below.
- Navigate to https://portal.azure.com/#home and sign in to the Azure portal using the credentials of an administrator.
- If your account gives you access to more than one tenant, select your account in the upper right corner. Set your portal session to the Azure AD tenant that you want.
- From the left-pane, select Azure Active Directory.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-1.png)
- In Azure Active Directory, select App registrations from the left-pane
![finding-client-id-and-secret](../images/finding-client-id-and-secret-2.png)
- Select New registration.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-3.png)
- In the Register an application section, enter a meaningful application name to display to users. Select who can use this application based on your environment and click Register.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-4.png)
- Once you have registered the application, click on the View API permissions button.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-5.png)
- Select Add a permission.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-6.png)
- Select Microsoft Graph.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-7.png)
- Select Application permissions. Using the search box provided, add the following permissions: Application.ReadWrite.All, Device.ReadWrite.All, Directory.ReadWrite.All, Domain.ReadWrite.All, Group.Read.All, Group.ReadWrite.All, ServicePrincipalEndpoint.ReadWrite.All, Sites.FullControl.All, User.Read.All, and User.ReadWrite.All. Click the Add permissions button.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-9.png)
- Once you’ve selected all the graph permissions, your API permissions screen will look similar to this.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-20.png)
- Select Add a permission and select SharePoint.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-11.png)
- Select the following SharePoint permissions: Sites.FullControl.All (Application permission), TermStore.ReadWrite.All (Application permission), User.ReadWrite.All (Application permission), User.ReadWrite.All (Delegated permission).
![finding-client-id-and-secret](../images/finding-client-id-and-secret-12.png)
- Select the Grant admin consent for <Tenant name> button, where <Tenant name> will be the name of your Azure tenant.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-13.png)
- Select Yes to confirm your choice.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-14.png)
- Click Certificates and secrets from the left-pane.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-15.png)
- Select the New client secret button.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-16.png)
- Provide a description for the client secret, the duration for which the client secret will be valid, and click Add.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-17.png)
- Copy the string under the column Value. You won't be able to retrieve it after you perform another operation or leave this page. Use the copy icon marked below.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-18.png)
- Click Overview in the left-pane and copy the client ID.
![finding-client-id-and-secret](../images/finding-client-id-and-secret-19.png)
You can now use the client ID and secret for the duration specified in the expiration field, after which you’ll have to repeat the process.