Dynamics 365 Sales Query Authentication Guide
    • Dark
      Light

    Dynamics 365 Sales Query Authentication Guide

    • Dark
      Light

    Article Summary

    Overview

    This is a step-by-step guide to acquiring credentials for authorizing the Dynamics 365 Sales Query component for use in Matillion ETL.

    Note
    • The Dynamics 365 Sales Query connector uses an OAuth entry for third-party authentication.
    • While connector properties may differ between cloud data warehouses, the authentication process remains the same.
    • Most third-party apps and services that connect to Microsoft data can be set up for use in Matillion ETL through the Microsoft Azure Portal using much of the same process.

    Prerequisites

    Begin by creating an OAuth entry in Matillion ETL, as described in Manage OAuth. You should then configure this OAuth entry using the Dynamics 365 Sales credentials, obtained as described below.


    Acquiring Dynamics 365 Sales credentials

    1. Log in to the Microsoft Azure Portal, and enter valid login credentials to continue. On the Microsoft Azure dashboard, click App registrations on the Azure services menu. If App registrations is not visible, click More services, on the right of the menu for a longer list of options.
    2. On the App registrations page, click + New registration.
    3. On the Register an application page, provide details for the following fields:
      • Name: A name for the app.
      • Supported account types: Select Accounts in any organizational directory (Any Azure AD directory - Multitenant).
      • Redirect URI: Select Web in the drop-down field and paste the Callback URL copied from the Manage OAuth window in Matillion ETL earlier. Note that although the page states this field is optional, you must complete it.
    4. Click Register.
    5. The browser will redirect to the Overview page on the app's newly created dashboard. From here, copy the credentials to the right of Application (client) ID and Directory (tenant) ID, as they will be required later in authorizing for use in Matillion ETL.
    Note

    When copying the credentials, some browsers may add a space to the end of the string. Watch out for this as it will cause the credentials to fail.

    1. On the menu on the left, click Authentication. Scroll down to the Implicit grant and hybrid flows section, and select the checkbox next to ID tokens (used for implicit and hybrid flows), then click Save at the top of the page.
    2. Click Certificates & secrets on the menu on the left, and on the Certificates & secrets page click + New client secret.
    3. The Add a client secret page will appear to the right. Provide details for the following fields:
    • Description: Provide a description of the client secret.
    • Expires: Use the Expires dropdown to select when the client secret should expire, then click Add.
    1. You will automatically be returned to the Certificates and secrets page, where the new client secret will appear in the list in the Client secrets tab. Copy the client secret Value, as it will be required in authorizing for use in Matillion ETL.
    Note
    • Make sure to copy the client secret immediately as it may appear only once.
    • When copying the client secret, some browsers may add a space to the end of the string. This will cause the credentials to fail.
    1. Click API permissions on the menu on the left, then click + Add a permission to open the Request API permissions panel on the right of the page.
    2. In the Request API permissions panel, click Dynamics CRM in the list of Microsoft APIs.
    3. This will open the Dynamics CRM panel. Select Delegated permissions, and then select user_impersonation Access as the signed-in user. Then click Add permissions.
    4. Click Expose an API in the menu on the left.
    5. Before a scope can be added, an Application ID URI will need to be set. The application ID URI is a URI that uniquely identifies the application in your Azure Active Directory. Click Set to the right of the Application ID URI field and replace the suggested URI with your preferred URI to be associated with the app, then click Save.
    6. Click + Add a scope. The Add a scope panel will appear on the right. Provide details for the following required fields:
    • Scope name: A display name for the scope when access to the API is requested. Best practice dictates using a <resource.operation.consent> name structure.
    • Who can consent? Select which users can consent to this scope in directories where user consent is enabled: Admins and users, or Admins only.
    • Admin consent display name: A name for the scope to be displayed on admin consent pages.
    • Admin consent description: A detailed description for the scope, to be displayed on admin consent pages.
    • User consent display name: A name for the scope to be displayed on user consent screens.
    • User consent description: A detailed description for the scope to be displayed on user consent screens.
    1. Click Add scope.
    2. Next, navigate to the Office 365 Home page, giving your sign-in credentials if requested. Click the Business Apps tab at the top. Click the Dynamics 365 - custom app. This will open a Dynamics 365 dashboard. The page's URL will contain your Dynamics 365 account URL, which is required in authorizing for use in Matillion ETL. Copy everything before and including dynamics.com. For example, if the URL is https://companyname.crm11.dynamics.com/main.aspx#414717258, you will need https://companyname.crm11.dynamics.com.
    3. Return to the Manage OAuth dialog in Matillion ETL to complete the OAuth configuration.