Configure lead management for Dynamics 365 Customer Engagement

This article describes how to set up Dynamics 365 Customer Engagement (previously named Dynamics CRM Online). Read more about the change in Configure server-based authentication with Customer Engagement and SharePoint Online to process sales leads from your commercial marketplace offer.

Note

These instructions are specific for the Microsoft-hosted cloud environment for Dynamics 365 Customer Engagement. Connecting directly to a Dynamics on-premises environment isn't currently supported. There are other options for you to receive leads, such as configuring an HTTPS endpoint or an Azure table.

Prerequisites

The following user permissions are necessary to complete the steps in this article:

  • Administrator rights on your Dynamics 365 Customer Engagement instance to be able to install a solution.
  • Tenant admin rights to create a new service account for the lead service used to send leads from commercial marketplace offers.
  • Access to the admin portal.
  • Access to the Azure portal.

Install the solution

  1. Download the Microsoft Marketplace Lead Writer solution, and save it locally to your computer.

  2. Sign in to Power Apps using the credentials you want to import your solution to. Go to the right environment.

    Screenshot illustrating the Select Environment panel.

  3. Go to Solutions from the left navigation menu and select Import Solution. Select Browse, and go to where you saved the Microsoft Marketplace Lead Writer solution that you downloaded in step 1.

    Screenshot illustrating the Import Solution button.

    Note

    If you don't see the options in the following screen, you don't have the permissions you need to proceed. Contact an admin on your Dynamics 365 Customer Engagement instance.

  4. Complete importing the solution by following the Import solution wizard.

Configure user permissions

To write leads into your Dynamics 365 Customer Engagement instance, you must share a service account with Microsoft and configure permissions for the account.

Use the following steps to create the service account and assign permissions. You can use Microsoft Entra ID or Office 365.

Note

Skip to the corresponding instructions based on the authentication option you select. See Microsoft Entra ID or Office 365.

Microsoft Entra ID

We recommend this option because you never need to update your username or password to keep getting leads. To use the Microsoft Entra option, you provide the App ID, Application Key, and Directory ID from your Active Directory application.

To configure Microsoft Entra ID for Dynamics 365 Customer Engagement:

  1. Sign in to the Azure portal. In the left pane, select Microsoft Entra ID.

  2. Select Properties, and copy the Directory ID value on the Directory properties page. Save this value because you need to provide it in the publishing portal to receive leads for your marketplace offer.

  3. Select App registrations from the Microsoft Entra left pane, and then select New registration on that page.

  4. Enter a meaningful name for the application name.

  5. Under Supported account types, select Accounts in any organizational directory.

  6. Under Redirect URI (optional), select Web and enter a URI, such as https://contosoapp1/auth.

  7. Select Register.

    Screenshot illustrating the Register an application page.

  8. Now that your application is registered, access the application's overview page. Copy the Application (client) ID value on that page. Save this value because you need to provide it in the publishing portal and in Dynamics 365 to receive leads for your marketplace offer.

    Screenshot illustrating the Application (client) ID box.

  9. Select Certificates & secrets from the app's left pane, and select the New client secret button. Enter a meaningful description for the client secret, and select the Never option under Expires. Select Add to create the client secret.

    Screenshot illustrating the Certificates and secrets menu item.

  10. As soon as the client secret is successfully created, copy the Client secret value. You won't be able to retrieve the value after you leave the page. Save this value because you need to provide it in the publishing portal to receive leads for your marketplace offer.

  11. Select API permissions from the app's left pane, and then select + Add a permission.

  12. Select Microsoft APIs, and then select Dynamics CRM as the API.

  13. Under What type of permissions does your application require?, make sure Delegated permissions is selected.

  14. Under Permission, select the user_impersonation check box for Access Common Data Service as organization users. Then select Add permissions.

    Screenshot illustrating the Add permissions button.

  15. After you complete steps 1 through 14 in the Azure portal, go to the Create an Application User step and complete steps 1 through 7. In this step, you only create an Application User for the above-created Microsoft Entra registered application.

  16. Go to the "Security settings" section in this article to finish configuring the connection for this user.

Office 365

If you don't want to use Microsoft Entra ID, you can register a new user on the Microsoft 365 admin center. You're required to update your username and password every 90 days to continue getting leads.

To configure Office 365 for Dynamics 365 Customer Engagement:

  1. Sign in to the Microsoft 365 admin center.

  2. Select Add a user.

    Screenshot illustrating the Microsoft 365 admin center Add a user option.

  3. Create a new user for the lead writer service. Configure the following settings:

    • Enter a username.
    • Enter a password, and clear the Make this user change their password when they first sign in option.
    • Select User (no administrator access) as the role for the user.
    • Select Dynamics 365 Customer Engagement Plan as the product license, as shown in the following screen. You're charged for the license you choose.

Save these values because you need to provide the Username and Password values in the publishing portal to receive leads for your marketplace offer.

Screenshot illustrating the Microsoft 365 admin center New user pane.

Security settings

The final step is to enable the user you created to write the leads.

  1. Sign in to the Power Platform Admin center as a System Administrator.

  2. Select Environments, and then select an environment from the list.

  3. Select Settings.

  4. Select Users + permissions, and then select Application users.

  5. Select the user that you created in the Configure user permissions section of this document. Then select Edit security roles.

    Screenshot illustrating the Configure User Permissions screen.

  6. Search for the role Microsoft Marketplace Lead Writer, and select it to assign the user the role.

    Screenshot illustrating the Assign User button.

    Note

    This role is created by the solution that you imported and only has permissions to write the leads and to track the solution version to ensure compatibility.

  7. Go back to the Users + permissions, and then select Security Roles. Search for the role of Microsoft Marketplace Lead Writer, and select it.

    Screenshot illustrating the   Security Role option.

  8. Select the dropdown to "Direct User (Basic) access level and Team privileges" for the Member's privilege inheritance as shown in the below screenshot.

    Screenshot illustrating the  Direct User option.

  9. Select the dropdown to "Show all tables" in the Tables Tab as shown in the below screenshot.

    Screenshot illustrating the  Show Tables option.

  10. Search for the User Entity UI Settings table under Core Records and select the "User" privilege dropdown option to Create, Read, and Write permissions for that entity.

    Screenshot illustrating the User Entity UI Settings.

  11. Search for the System Job table under Customization and select the "Organization" privilege dropdown option to Read, Write, and AppendTo permissions for that entity.

    Screenshot illustrating the System Job view.

  12. Select Save and close.

Configure your offer to send leads to Dynamics 365 Customer Engagement

To configure the lead management information for your offer in the publishing portal:

  1. Go to the Offer setup page for your offer.

  2. Under the Customer leads section, select Connect.

    Screenshot illustrating the Customer leads section

  3. In the Connection details pop-up window, select Dynamics 365 Customer Engagement for the lead destination.

    Screenshot illustrating the Lead destination box

  4. Enter the URL for the Dynamics 365 instance, such as https://contoso.crm4.dynamics.com.

  5. Select the method of Authentication, either Microsoft Entra ID or Office 365.

  6. If you selected Microsoft Entra ID, enter the Application (client) ID (for example, aaaabbbb-0000-cccc-1111-dddd2222eeee), Directory ID (for example, aaaabbbb-0000-cccc-1111-dddd2222eeee), and Client secret (for example, 1234ABCDEDFRZ/G/FdY0aUABCEDcqhbLn/ST122345nBc=).

    Screenshot illustrating Authentication with Microsoft Entra ID selected

  7. If you selected Office 365, enter the User name (for example, [email protected]) and Password (for example, P@ssw0rd).

  8. Select OK.

To make sure you're successfully connected to a lead destination, select the Validate button. If successful, you have a test lead in the lead destination.

Note

You must finish configuring the rest of the offer and publish it before you can receive leads for the offer.