Microsoft Dynamics CRM v2 component

Connection to Microsoft Dynamics CRM

A step-by-step instruction on how to connect to Microsoft Dynamics CRM.

How to Connect to Microsoft Dynamics CRM

Connecting to Microsoft Dynamics CRM involves several steps to ensure a secure and reliable connection. Follow the guide below to successfully set up the connection.

Before you begin, make sure you have the following prerequisites in place:

  1. Microsoft Azure Account: You need access to a Microsoft Azure account with the necessary permissions to create and manage applications.

  2. Access to Your CRM Instance: Ensure you have access to the Microsoft Dynamics CRM instance you intend to connect to.

Step 1: Register an OAuth App in Azure Active Directory

  1. Log in to Azure Portal:

Go to Azure Portal and log in using your Microsoft credentials.

  1. Access App Registrations:

Select App registrations in the Azure Portal.

App registrations

  1. Create a New Registration:

Click on New registration.

New registration

  1. Enter Registration Details:

Fill in the following information:

  • Name: Choose any name for your registration.
  • Supported account types: Select “Accounts in this organizational directory only.”
  • Redirect URL:
    • Platform: Choose Web.
    • URL: Enter https://your-tenant-address/callback/oauth2.

New registration process

Step 2: Add CRM Permissions to the App

  1. Access API Permissions:

Click on API Permissions.

API Permission

  1. Add a Permission:

Click Add a permission.

Add a permission

  1. Select Dynamics CRM:

Search for and select Dynamics CRM.

Select Dynamics CRM

  1. Choose Permissions:

Check the user_impersonation checkbox and click Add permissions.

user_impersonation checkbox

  1. Grant Admin Consent:

Click Grant admin consent and confirm by clicking Yes.

Grant admin consent

Step 3: Generate a Secret for the App

  1. Access Certificates & Secrets:

Click on Certificates & secrets.

Certificates & secrets

  1. Generate a New Client Secret:

Click New client secret.

New client secret

  1. Enter Secret Details:
  • Provide a description for the secret and select the desired expiration period (maximum 24 months).
  • Click Add.

Enter Secret Details

  1. Save Secret Value:
  • Save the value displayed in the Value column. You will need this when creating an Auth Client on elastic.io platform.

Save Secret Value

Step 4: Create an Auth Client on Your Platform

  1. Create a New Credential:

Create a new credential on elastic.io platform for connecting to Microsoft Dynamics CRM.

Create a New Credential on platform

  1. Configuration Details:
  • Fill in the following details:
    • Name: Provide a name for this credential (free text).
    • Client Id: Use the Application ID copied from Microsoft Azure -> API permissions -> Application ID.

    Client Id

    • Client Secret: Add the client secret generated in the previous step.
    • Authorization Endpoint: Set it to https://login.windows.net/common/oauth2/authorize?resource={URL encoded URL of CRM instance}. For example, if your CRM instance URL is https://orgfb974624.crm4.dynamics.com/, the encoded URL becomes https%3A%2F%2Forgfb974624.crm4.dynamics.com%2F.
    • Token Endpoint: Set it to https://login.windows.net/common/oauth2/token.

That’s it! You’ve successfully configured the connection to Microsoft Dynamics CRM using OAuth. Make sure to test the connection on your platform to ensure it’s working as expected.

Warning: To maintain a smooth experience, we recommend reusing stored credentials where possible. Duplicating secrets across OAuth clients can result in errors and complications.