Dynamics 365 Business Central Query authentication guide
This is a step-by-step guide to acquiring credentials for authorizing the Dynamics 365 Business Central Query component for use in Matillion ETL.
- The Dynamics 365 Query Business Central connector uses OAuth 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.
Note
Older versions of Dynamics 365 Business Central used Web Service Access Key authentication. Matillion ETL still supports an older version of the Dynamics 365 Business Central Query connector that will use a Web Service Access Key, and this process is documented below. This method is deprecated, however, and replaced by the OAuth method described in this article.
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 credentials, obtained as described below.
The OAuth entry requires four pieces of information:
- The Client ID, Client Secret, and Azure Tenant are obtained from the Azure Portal as described in Acquiring Azure credentials.
- The Organization URL is determined as described in Organization URL, below.
Configure Dynamics 365 API
- In the Request API permissions panel, click Dynamics 365 Business Central in the list of Microsoft APIs.
- This will open the Dynamics 365 Business Central panel. Select Delegated permissions, and then select user_impersonation Access as the signed-in user. Then click Add permissions.
- Click Expose an API in the menu on the left.
- Before a scope can be added, an Application ID URI will need to be set. Click Set to the right of the Application ID URI field to edit it. Replace the suggested URI with the URI to be associated with the app, then click Save.
- 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 screens.
- Admin consent description: A detailed description for the scope to be displayed on admin consent screens.
- 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.
- Scope name: A display name for the scope when access to the API is requested. Best practice dictates using a
- Click Add scope.
Next, determine the organization URL, as described in the following section.
Organization URL
The OAuth entry in Matillion ETL requires a Business Central Organization URL. There are two possible forms of this URL, depending on whether you are using the Dynamics 365 Business Central Query component to retrieve common service data (for example, accounts, sales orders, sales invoices) or custom objects and service data (KPIs, reports, individual entities, or other feeds). In Dynamics 365 Business Central, search for Web Services to get an idea of what data is exposed by these services.
Organization URL for common service data
- Navigate to your Office 365 Home page, passing your login credentials if requested.
- Search for and click the Business Central app. If not immediately visible, it should be located in the All apps section. This will open the Business Central Dynamics 365 dashboard.
- Copy the URL of this dashboard from the browser's address bar, including the unique identifier string after the domain name. For example:
https://businesscentral.dynamics.com/09d19996-a185-4b6c-8332-37120f9bba10/
This is the Organization URL you'll need when configuring the OAuth.
Organization URL for custom service data
Use the following Organization URL for custom service data: https://api.businesscentral.dynamics.com/v1.0/ODataV4/
Note
If you need both common and custom service data, you'll need to create two separate OAuth entries in Matillion ETL; both will use the same app created in Acquiring Azure credentials, but one should have the common service URL and the other should have the custom service URL.
Now return to the Manage OAuth dialog in Matillion ETL to complete the OAuth configuration with these details.
Using Web Service Access Key authentication
Note
- This section is for customers using versions of Matillion ETL before 1.62.
- Web Service Access Key authentication has been deprecated by Microsoft. We recommend that customers update their Matillion ETL instances to version 1.62 or later to use the OAuth method of authenticating the Dynamics 365 Business Central Query component.
- Navigate to the Dynamics 365 Business Central Portal and enter valid login credentials.
- On the Dynamics 365 Business Central dashboard, click the Search icon on the menu in the top right.
- In the Tell me what you want to do field, enter Users. A list of options will then appear below the search field. Click Users.
- On the Users page, click the User Name to be associated with the API.
- Copy the credential to the right of Web Service Access Key as it will be required when configuring the authorization in Matillion ETL.
- Create an orchestration job and add a Dynamics 365 Business Central Query component to the job canvas.
- In the Properties panel at the bottom of the screen, click ... next to the Access Key property.
-
In the Access Key dialog, select the Store in component option, and paste the Web Service Access Key (copied from the Dynamics 365 Business Central Portal earlier) into the field. Then click OK.
Note
Alternatively to storing the access key in the component, you can use the Manage Passwords feature to store the access key behind a named entry.
-
If the Access Key is entered correctly, the connector should be authenticated and the status of the property will be OK.