In this article we’ll walk through all the necessary steps involved in setting up a new Application User in Dynamics 365, including creating a new Azure App Registration to use with the App User.
Step 1:
Create an App registration in Azure, under Azure Active Directory.
Set the Name - this will become the name of the user in Dynamics 365.
Leave the Supported account type as Single tenant (the default value).
Step 2:
Once created, copy the Application (client) ID of the new App registration. This will be used later as the Client ID.
Step 3:
Navigate to Certificates & secrets and click New client secret, under Client secrets.
Enter a description for the client secret (optional).
Select the expiry date for the client secret. The maximum you can select is 24 months. After the expiry, a new secret will need to be generated, and any applications using the secret will need to be updated. It’s worth setting a reminder for this, to avoid any service interruptions.
Step 4:
Once the secret is created, copy the Value. This will be used as the Client Secret later. This is the only chance you’ll have to copy the secret, so be sure to save it somewhere safe. If you lose the value, you can always generate another later.
Step 5:
Navigate to API permissions and select Add a permission.
From the Request API permissions screen, under Microsoft APIs, select Dynamics CRM.
Under Delegated permissions, select user_impersonation, and then Add permissions.
Step 6:
Open the Power Platform Admin Center as a System Administrator, and select your Dynamics 365 Environment, then select Settings.
Navigate to Application users, under Users + permissions.
Step 7:
Click New app user from the list of Application users.
From the Create a new app user screen, click Add an app and select the App you created earlier.
Select the Business unit to add the app user to.
Select the Security roles to assign to the user once created. For example, System Administrator.
Click Create, and you’ll see the user has been added to your environment. You’ll also notice the App ID is the same Application (client) ID copied in step 2.
Step 8:
You should now have the Client ID copied from step 2, and the Client Secret copied from step 4. Combine these with your Environment URL, and you’ll have everything you need to grant your application access to your Dynamics 365 environment.