Connecting to Microsoft Dynamics 365 CRM
fSeries connects to Microsoft Dynamics 365 through one of two authentication methods - by configuring OAuth, or by using a Client Secret. Microsoft recommends using a Client Secret, which we will discuss here. This process involves creating an App Registration in Azure under Active Directory, and then adding an fSeries Application User to Dynamics 365.
Once configured, you can enter a connection string into a Dynamics type fSeries Data Source, and pull information from your CRM instance.
Creating the Azure App Registration
-
Click “New Registration”
Enter a suitable name, such as “fSeries Dynamics CRM”
The supported account type should be “Accounts in any organisational directory (Any Azure AD directory - Multitenant)”
The Redirect
URI is not needed, so click the Register button and copy the
Application (client) ID into a notepad to keep it for later.
Within your new registration, head to “Certificates & secrets” > Client secrets tab > “New client secret”
Enter an optional description and set the expiry date for the secret. This date can be any time in the future.
Once the secret has been created, immediately copy the client secret Value key into notepad. It will not be shown again so ensure it is copied safely.
From the menu on the left, select “
API Permissions” then “Add a permission”
Select “Dynamics CRM”
Within “Permissions” tick the “user_impersonation” option and then the “Add permissions” button.
Adding the fSeries Application User to Dynamics 365
-
Select your Dynamics 365 environment and then the “Settings” button from the top of the screen
Under “Users + permissions”, click “Application Users”
Click “New app user”
Click “Add an app”
Select the App Registration that you created earlier, such as “fSeries Dynamics CRM”
Select the Business Unit to add the app user to
Select the Security roles to assign the user once created, for example System Administrator
Click Create. You should notice the App ID is the same Application (client) ID created earlier
Adding the Connection String to fSeries
Now that the App Registration and User has been created, you are ready to connect from fSeries.
Within your Dynamics Data Source in fSeries, enter your connection string, which should be as follows:
AuthType=ClientSecret;url=https://yourcrmserver.crm.dynamics.com;ClientId=YourClientId;ClientSecret=YourClientSecret
Enter the connection string as above, substituting the Url, ClientId and ClientSecret accordingly, and use the Test button to test your connection.