How to connect the Business Central API with Synapse Pipelines / Azure Data Factory (ADF)

After struggling a bit longer to connect the Business Central API to my Synapse Pipelines and painstakingly gathering the information, I want to share my findings with you. Maybe it will help you get to your solution faster.

In my search on this topic, I first found Ben Zhai’s post in the Q&A section of Microsoft Learn Platform on the question “How to connect Business Central to Azure Data Factory“. Who in turn referred to a post by Vjekoslav Babic on “How do I: Really set up Azure Active Directory based authentication for Business Central APIs“.

But it wasn’t until Microsoft Dynamics 365 Business Central documentation on “Using Service-to-Service (S2S) Authentication” that I had a breakthrough.

Since the mentioned posts are already a bit outdated and the Microsoft documentation does not contain any pictures for orientation and is quite general in some places. You now get my own step by step guide.

Register an Azure AD Application for authentication to Business Central

Sign in to your Azure Portal and go to the Azure Active Directory.

Azure Active Directory on portal.azure.com

Go here to App registrations and then to New regestration

App registrations at Azure Active Directory

In the form I entered the following values and clicked Register:
Name: Business Central API – Specify a unique name for your application.
Supported account types: Accounts in this organizational directory only (Microsoft only – Single tenant) or Accounts in any organizational directory (Any Azure AD directory – Multitenant)
Redirect URI: https://businesscentral.dynamics.com/

Register an application at Azure Active Directory

Then an overview opens, from which we save the Application (client) ID and Directory (tenant) ID for later, before we click on “Add a certificate or secret“.

Application IDs

Here we create a “New client secret“. As Description I have chosen “Synapse Pipelines” and set Expires to “24 month”.

Add a client secret to the app

Then we save the key from the Value field for later use and switch to “API permissions“.

Add API permissions to app

Here, we add request API permissions via “Add a permission“. We choose Dynamics 365 Business Central as the Microsoft API.

Request API permissions on Dynamics 365 Business Central

The required permissions are “Application permissions“.

Request API permissions on Dynamics 365 Business Central - Application permissions

For Application permissions we select “API.ReadWrite.All” and “Automation.ReadWrite.All” and add them via “Add permissions“.

Request API permissions on Dynamics 365 Business Central - Application permissions - ReadWrite.All

Afterwards we confirm the entries via “Grant admin consent for <tenant name>“.

Request API permissions on Dynamics 365 Business Central - Application permissions - Grant admin

Setting up the Azure AD application in Business Central

Open Business Central and search for Azure Active Directory Applications and open the page.

Dynamics 365 Business Central - Azure Active Directory Applications

On the page that opens, select New.

Dynamics 365 Business Central - Azure Active Directory Applications - New

I have entered the following values in the form that opens:
Client ID: the previously saved Application (Client) ID
Description: Business Central API for Synapse
State: Enabled
User Groups: D365 INTERNAL ADMIN (Code)

Dynamics 365 Business Central - Azure Active Directory Applications - Setup

Setting up the Business Central API connection in Synapse Analytics

In the Synapse Analytics workspace, we start in this example by clicking the Ingest button.

Synapse Pipelines - Ingest

In the Copy Data tool dialog, in this example, we accept the default with “Built-in copy task” and “Run once now” and click “Next“.

Synapse Pipelines - Bulid-in copy task

As source type for the source data store we choose OData.

Synapse Pipelines - Source type

Then we create a connection via “New connection” with the following settings.
Name: Business Central API
Service URL: https://api.businesscentral.dynamics.com/v2.0/<tenant id>/production/api/v2.0/
Authentication type: Service principal with Key
AAD resource: https://api.businesscentral.dynamics.com
Tenant: the previously saved Directory (tenant) ID
Service principal ID: the previously saved Application (Client) ID
Service principal key: the previously saved client secret key value
The settings can be checked via “Test connection” and then accepted with “Create“.

Synapse Pipelines - New connection

With the successful connection we can now select the existing tables (entities) and set up further copying to any source.

Synapse Pipelines - Source tables


I hope this little tutorial helped you to set up a connection to the Business Central API and would be happy if you leave a short comment about it. Also, please let me know if you would recommend a different approach.

More details about the different settings and their meaning can be found in the official Microsoft documentation. Using Service-to-Service (S2S) Authentication

In the meantime, I found another blog post by Arend-Jan Kauffmann “Service to service authentication in Business Central 18.3 – How to set up” that also describes the needed setups in Azure and Business Central.

Veröffentlicht von

Marcus Wegener

Marcus Wegener

Marcus Wegener ist Anwendungsentwickler für Business Intelligence und erstellt Lösungen, mit denen sich große Datenmengen schnell analysieren lassen. Kunden nutzen seine Lösungen, um die Vergangenheit zu analysieren, die Gegenwart zu steuern und die Zukunft zu planen, um damit mehr Erfolg zu generieren. Dabei ist seine einzigartige Kombination aus Wissen und Auffassungsgabe ein Garant für ihren Erfolg.

Ein Gedanke zu „How to connect the Business Central API with Synapse Pipelines / Azure Data Factory (ADF)“

  1. Thank you, that helped us a lot!

    Something to consider is that you have to modify the name of the environments in the service URL of your example if your environment name is not “production”.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

I accept that my given data and my IP address is sent to a server in the USA only for the purpose of spam prevention through the Akismet program.More information on Akismet and GDPR.