Skip to main content

Create an Azure App User for the Service Connection

The answer is an Azure app registration with a client ID and secret, linked to a Power Platform application user. This page walks through all three stages.

Credentials stopped working? It's usually an expired secret

This is the most common cause of a CRM connection that suddenly stops verifying. Fix it in two steps:

  1. Create a new client secret (Stage A, step 8).
  2. Update it in the Management App: open the CRM connection record and use its VERIFY URL to enter the new secret (see Stage C).

You do not need a new app registration or a new application user for this.

What you'll need

  • Azure Active Directory Admin permissions in the same Azure tenant as your CRM
  • Power Platform Admin permissions
  • The AutoMerge Managed Solution already installed (it provides the security role you'll assign)

Overview

Stage A happens once per Azure tenant. Stages B and C happen once per CRM organization (Production, Sandbox/Dev, Sandbox/Test, and so on).

StageWhereWhat happens
AAzure PortalCreate the app registration, add permissions, create a secret
BPower Platform AdminAdd an application user linked to that Azure app
CManagement AppEnter the client ID and secret, verify the connection

Stage A. Azure portal setup

Do this stage only once

These app registration steps are needed once per Azure tenant, and the result can be referenced by multiple CRM organizations (Production, Sandbox/Dev, Sandbox/Test). If you already have an app with saved client ID and secret values, skip to Stage B.

A-1. Open Azure Active Directory

Sign in to portal.azure.com as someone with Active Directory Admin privileges. Search for and open Azure Active Directory.

Searching for Azure Active Directory in the Azure portal

A-2. New app registration

In the left navigation, choose App registrations, then click New registration.

App registrations with the New registration button

A-3. Name it

Give the application a descriptive name. Keep the default Single tenant access, skip the Redirect URI section, and click Register.

Naming the new app registration

A-4. Copy the client ID

Go to Overview in the left navigation and copy the Application (client) ID somewhere safe. You'll need it in Stage C.

Copying the Application (client) ID

A-5. Add the Dynamics CRM permission

Click API permissionsAdd a permission → find Dynamics CRM.

Adding an API permission

A-6. Grant user_impersonation

In the Request API permissions pane, keep the default Delegated permissions, check user_impersonation, and click Add permissions.

Selecting the user_impersonation delegated permission

Back in API permissions, click Grant admin consent….

Granting admin consent

A-8. Create a client secret

Go to Certificates & secretsNew client secret. Give it a descriptive name and an expiration at least 12 months out, since AutoMerge subscriptions typically run 12 months.

Creating a new client secret

A-9. Save the secret value now

Find the new secret and copy its Value. This is the equivalent of a password and you'll need it in Stage C.

The secret value is shown once

Once you browse away from this page the value is no longer visible. Copy it before you navigate anywhere else.

Copying the secret value

Set yourself a reminder

Note the secret's expiration date and set a reminder one month before it. When a secret expires, the AutoMerge analysis service stops working.

If your secret has already expired, you only need to create a new secret and update it in the connection verify page (Stage C). You do not need a new app registration or a new application user.


Stage B. Power Platform setup

Do this stage once per CRM organization

Unlike Stage A, repeat this for every CRM organization the AutoMerge service needs to reach: Production, Sandbox/Dev, Sandbox/Test, and so on.

Sign in to admin.powerplatform.microsoft.com as someone with Power Platform Admin privileges.

B-1. Select the environment

In the Environments navigation, locate and select the environment (your CRM organization).

Choosing the environment in Power Platform admin

B-2. Open Settings

Click the Settings button at the top of the environment.

Environment settings

B-3. Application users

Expand Users + permissions and click Application users.

Application users under Users + permissions

B-4. New app user

Click + New app user, then in the right-hand pane click + Add an app.

Creating a new application user

B-5. Select your Azure app

Look up and select the app you registered in Stage A, then click Add.

Selecting the registered Azure app

B-6. Business unit and security role

Select a Business Unit (typically your root unit) and choose the AutoMerge Analysis/Tagging AppUser - Minimum Privs security role, which ships with the AutoMerge Managed Solution.

Assigning the security role

Screenshot shows the old name

The screenshot above still shows the role's old name, AutoMerge Non-Admin User. It has since been renamed to AutoMerge Analysis/Tagging AppUser - Minimum Privs; the role itself is unchanged.

Don't see the role?

The AutoMerge Analysis/Tagging AppUser - Minimum Privs role comes from our managed solution. If it's missing, the solution isn't imported into this organization. See Install the AutoMerge Solution.

About the AutoMerge Analysis/Tagging AppUser - Minimum Privs role

It's a deliberately minimal role: org-wide read/write on Accounts, Contacts, and Leads. That's enough for the analysis engine to find duplicates and tag the results back into your CRM.

By design it does not have enough privileges to merge tagged duplicates. That only matters if you submit requests with Operation = AutoMerge from the Management App. Merging that users perform directly inside the CRM runs under their own security roles and is unaffected.

If you will submit Operation = AutoMerge requests, only the built-in System Administrator role is guaranteed to avoid merge privilege errors across all CRM environments, but granting that role should be a considered decision, not a default.

B-7. Create

Review and click Create.

The completed application user form

You should land on a confirmation.

Application user confirmation


Stage C. Verify the connection

Sign in to the AutoMerge Management App at automerge.crm4.dynamics.com.

C-1. Open the CRM connection

From your customer profile, open the CRM connection you're setting up.

Opening the CRM connection record

C-2. Open the verify page

If it isn't, check Clear Credentials and save.

The VERIFY URL can be shared with anyone, even someone without Management App access, so they can update the credentials themselves. For Management App users, the verify page is also embedded right in this form and editable directly here.

Opening the connection verify page

C-3. Enter the credentials and verify

On the verify page:

FieldValue
App/ClientIDFrom step A-4
Secret/KeyFrom step A-9
Organization URLYour CRM org URL
Fill in the Secret/Key Expiration Date

If you enter the secret's expiration date here, you'll get a reminder email before it expires so you can update it in time. Skipping this field means no warning, and an expired secret stops the AutoMerge service until someone notices and fixes it.

Verifying is two steps, both buttons on the page: click 1. Verify Connection first, then 2. Update CRM Connection to save the verified credentials back onto the connection record.

That's it. The AutoMerge service can now reach this organization.

Next steps