Create A Data Source Connection
Prerequisites
Ensure to perform the following before adding a data source connection
Creating and managing a data source connection
After registering and setting up Microsoft Entra application in Business Central, perform the following
Register a Microsoft Entra application for authentication to Business Central
Sign in to Microsoft Azure portal.
-
Go to Microsoft Entra ID > App registrations > +New registration. The Register an application page is displayed.
In Name, provide the name of the application you want to register with Microsoft Entra ID.
In Supported Account Types, select either Accounts in this organizational directory only (Microsoft only - Single tenant) or Accounts in any organizational directory (Any Microsoft Entra ID directory - Multitenant).
-
Click Register. The Overview page is displayed.
Note: Copy the Application (client) ID and the Directory (tenant) ID of the registered application from the Overview page.
Go to Certificates & secrets > Client secrets > +New client secret. The Add a client secret window is displayed.
In Description, enter a description for your client secret.
In Expires, choose the appropriate expiration time.
-
Select Add. The Client secrets tab is displayed.
Make note of the generated secret value.
-
Go to API permissions > +Add a permission > Microsoft APIs. Select Dynamics 365 Business Central. Select Application permissions > API.ReadWrite.All and Automation.ReadWrite.All, then select Add permissions.
The API permissions page will include one of the following entries:
API / Permission name Type Description Dynamics 365 Business Central / Automation.ReadWrite.All Application Full access to automation Dynamics 365 Business Central / API.ReadWrite.All Application Access to APIs and webservices -
(optional) Grant admin consent on each permission by selecting it in the list, then selecting Grant admin consent for <tenant name>.
This step isn't required if you'll be granting consent from the Business Central web client while setting up the Microsoft Entra application in Business Central.
Set up the Microsoft Entra application in Business Central
Complete these steps to set up the Microsoft Entra application for service-to-service authentication in Business Central.
In the Business Central client, search for Microsoft Entra applications and open the page.
Select New.
The Microsoft Entra application Card opens.
In the Client ID field, enter the Application (Client) ID for the registered application in Microsoft Entra ID that you have noted while registering a Microsoft Entra application for authentication to Business Central.
Fill in the Description field. If this application is set up by a partner, please enter sufficient partner-identifying information, so all applications set up by this partner can be tracked in the future if necessary.
Set the State to Enabled.
-
Assign permissions to objects as needed.
For more information, Assign Permissions to Users and Groups.
Important: Applications can't be assigned the SUPER permission set. Make sure that applications follow least-privilege principle and only assign permissions required for the integration to work.
Note:
The system permission sets and user groups called D365 AUTOMATION and EXTEN. MGT. - ADMIN provide access to most typical objects used with automation.
The EXTEN. MGT. - ADMIN permission set was introduced in Business Central 2021 release wave 1 as a replacement for the D365 EXTENSION MGT permission set in earlier versions.
-
(optional) Select Grant Consent and follow the wizard.
This step will grant consent to the API. This step is only required if you haven't granted consent from the Azure portal while registering the Microsoft Entra application for authentication to Business Central. You can only complete this step if you've configured a redirect URL in the registered Microsoft Entra app.
Tip: Pre-consent can be done by adding the Microsoft Entra application to the Admin agents group in the partner tenant. For more information, see Pre-consent your app for all your customers in the Graph documentation.
Create a data source connection
-
Click Connections > Create Connection. The Add New Data Source window is displayed.
-
Provide the following details and click Save.
Data Sources: Select the Other option as data source.
Connection Type: Select Microsoft Dynamics 365 Business Central as connection type.
Name: Indicates a name for the connection.
-
Host Name: Indicates the URL that hosts your data source, which is typically the endpoint for your Dynamics365 Business Central instance.
Example: https://api.businesscentral.dynamics.com
For more information, see Microsoft API Endpoints for Business Central.
Tenant ID: Indicates the tenant IDÂ value that you have recorded while registering Microsoft Entra ID for your application.
Client ID: Indicates the client ID value that you have recorded while registering Microsoft Entra ID for your application.
Client Secret: Indicates the client secret value that you have recorded while registering Microsoft Entra ID for your application.
Environment: Indicates the BC environment of the web service instance. If not provided, the default production environment will be used.
Company: Select the required company of the Business Central connection.
Display Empty Tables: If you want the empty tables to be displayed in the report, enable Display Empty Tables.
Display Record Count: If you want the record count to be displayed in the report, enable Display Record Count.
Table and Field Drop Format: Indicates how data should be displayed and organized in your reports.
Language: Indicates the language in which the data in reports should be displayed.
Drilldown Type: Select drilldown type as web client.
-
Web Client Drill Down Instance: Use the following format:
{tenantId}/{environment}
Examples:
6d1e6d56-8c8f-49e4-9d07-4fbe1f33bf53/Sandbox
yourdomain.com/Production
Web Client Drill Down Region Format: Indicates the regional format for the location of Business Central. For example, EN-US.
Key Algorithm: Indicates the method used to select the most appropriate key for querying data from your ERP system.
Web Service Timeout: This value is set by default.
Page Size: This value is set by default.
Max Message Size: This value is set by default.
Max Request Duration: This value is set by default.
-
Automatically import pre-built content: Indicates that the system will automatically import new prebuilt content as well as any updates to existing prebuilt content. Once enabled, the PrebuiltReports option becomes visible under Public Workspace on the Reports page.
If you want to import prebuilt content manually, edit the existing data source connection and select Re-import.
Edit, Delete, and View the Existing Connections
Click Connections. The Connections page is displayed, where a list of all existing Business Central Cloud connections created within your organization are available.
-
Click the three-dot action menu on the right side of each connection. A dropdown with the following options is displayed.
Edit: Select Edit to modify the connection details.
Delete: Select Delete to remove the connection.