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.
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).
Once created, copy the Application (client) ID of the new App registration. This will be used later as the Client ID.
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.
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.
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.
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.
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.
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.