Creating a Custom AzureAD Service Principal App
Creating a Custom Azure AD Service Principal App
When authenticating using an Azure Service Principal, you must create a custom AzureAD application and a service principal that can access the necessary resources.Procedure
The following steps create a custom Azure AD Service Principal application for most supported editions and and obtain the connection properties for the Azure Service Principal authentication, then sets up an application user for your Power Platform (Azure Service Principal) environment.For information on how to create a custom Azure AD Service Principal app for FinOps Online, see FinOps Online, below.
Create the Custom Azure AD Service Principal Application
- Log in to https://portal.azure.com.
- In the left-hand navigation pane, select Azure Active Directory > Manage > App Registrations and click New registration. The portal displays the Register an application page.
- Enter an application name.
- Specify that the new application can be used by Accounts in this organizational directory only.
- Click Register. The Portal displays the overview page for your new application.
- Navigate to Manage > App Registrations.
- In the API Permissions dialog, choose Dynamics CRM permissions. The Portal displays the Dynamics CRM menu.
- Choose Delegated permissions type, select User_impersonation, then click Add Permissions.
- Click yes.
- Still in the Portal's Power Platform Service Principal section, click Certificates & secrets > + New Client Secret. The Portal displays the Add a client secret form.
- Provide a description of the client secret (usually this is the same as the name you gave to your custom application) and choose an Expires date for the secret.
- Click Add.
- The Portal generates a Secret ID (a unique identifier) and a Value (the password) for the secret. These display only once, so record them for future use. (If you lose the key you will need to delete the secret and create a new one.)
Create the Application User
- Login in to https://admin.powerplatform.microsoft.com/home.
- In the navigation panel at left, click the Environments tab.
- Select the D365 environment.
- Navigate to Settings > Users + permissions.
- Select Application users.
- Click New app user > Add an app.
- Select the custom Service Principal application that you just created.
- Add the System administrator security role.
- Click Create.
- Assign a business unit.
- Click Create.
Procedure for FinOps Online
To create a custom Azure AD Service Principal application for use with Microsoft Dynamics 365 FinOps Online, you register the application with Microsoft Dynamics 365, generate a client secret for the custom application, configure the required permissions to use the application, and then register the application for Finance and Operations.Note: During registration in Microsoft Dynamics 365 for Finance and Operations, we recommend you supply a dedicated service account that has all the required permissions that must be performed. If no such account currently exists, create one before you begin the procedures below.
Register the application in the Azure AD portal
- Log in to https://portal.azure.com.
- Switch to the tenant where you want to register the application.
- In the left-hand navigation pane, select Azure Active Directory > App Registrations and click New registration. The portal displays the Register an application page.
- Enter an application name.
- For the account type, specify the Accounts in any organizational directory (Any Azure AD directory - Multitenant).
- Accept the default values for the remaining fields.
- Click Register. The Portal displays the overview page for your new application, which displays certain "essentials".
- Record the value for Application (client) ID for future use.
Generate the Client Secret
- Next to Client credentials, click Add a certificate or secret. The portal displays the Certificates and Secrete page.
- Click New client secret. The portal displays the Add a client secret panel.
- Specify a description for the secret (for example, "App Connect secret"), then select an expiry period.
- Click Add.
- The portal generates the client secret and displays it on the Certificates & secrets page.
- The secret is shown in full only this one time, so record the secret value now, for future use.
Configure required permissions
- In the left navigation panel, click API permissions.
- Navigate to Add a permission > Dynamics ERP > Application permissions.
- Select Connector.FullAccess permission, then click Add permissions add it.
- Navigate to Add a permission > Dynamics ERP > Delegated permissions.
- Select AX.FullAccess, CustomService.FullAccess, and OData.FullAccess, then click Add permissions add them.
- If any of the permissions you just added is Not granted for your domain, click Grand admin consent for yourdomain. Click Yes to confirm. The status of all permissions is updated to Granted.
Register the application with Microsoft Dynamics 365 Finance and Operations
- Open your Microsoft Dynamics 365 Finance and Operations account.
- Navigate to Modules > System administration > Setup > Azure Active Directory applications. The portal displays the Azure Active Directory applications page.
- Click New.
- At the Client Id field, enter the application (client) ID you reigistered in Azure AD.
- At the Name field, enter a name for the custom application.
- At the User ID field, select an appropriate service account user ID as described at the beginning of this section.
- Click Save.