TimeXtender can connect and extract data from a Dynamics 365 Sales instance using the CData Dynamics 365 Sales ADO.NET Provider. You may find more information on using this provider from the CData Provider Help Guide here.
This guide is broken down into multiple steps:
- Create an App Registration in Azure Active Directory
- Add the Data Source in TimeXtender
Create an App Registration in Azure Active Directory
For Dynamics 365 to authenticate a connection from an external application, you must first create an App Registration in Azure Active Directory. You can learn more about this process from Microsoft here, however, more direct steps are provided below.
Create the App Registration
- In the Azure Portal, navigate to Azure Active Directory
- Select App Registrations in the menu bar on the left & Select New Registration.
- Enter a name and select Accounts in any organizational directory (Multitenant).
- Enter a redirect URI, This can be something generic like (http://localhost:33333) or you may use your Organizational URL for your Dynamics instance (https://<company>.crm4.dynamics.com/).
- Select Register when you are done.
- Note down the Application ID which will be used later.
Create the App Secret
- After creating the App Registration, select Certificates & secrets.
- Select New Client Secret.
- Provide a description of the secret, and a duration. When done, select Add. (This key is encrypted after save, so it needs to be documented somewhere safe.)
- Note down the Client Secret Value which will be used later.
Add the API Permission
- Under the App Registration menu Select API Permissions.
- Select Add a permission
- Under Microsoft APIs, select Dynamics CRM
- Select Delegated permissions, then select user_impersonation, & click Add permissions
The API permission should look like it appears in the red box above.
Add the Data Source in TimeXtender
This data source can be found by navigating to the Dynamics 365 Sales CData provider in the list of availabel CData providers either in the ODX or the Business Unit.
Once you have added the data source configure the connection values as described below
Configure the Data Source Connection
- Enter your Organization URL for you Dynamics Instance. This should appear similar to https://<company>.crm4.dynamics.com/.
- Scroll down to the OAuth section of connection string options and set Initiate OAuth to REFRESH
- Set the OAuth Client Id to the Application ID of the App Registration created earlier.
- Set the OAuth Client Secret to the Client Secret of the App Registration created earlier.
- Click the Authorize OAuth button. This should launch a web browser and authorize your connection to Dynamics.
- Click the Test Connection button to ensure you have connected successfully.