Microsoft Dynamics 365 Business Central is a business management solution that automates and streamlines business processes. It helps small and mid-sized organizations to manage their business, including finance, manufacturing, sales, shipping, project management, services, and more. With Microsoft Dynamics 365 Business Central, companies can easily add functionality relevant to the region of operation, and it is customized to support highly specialized industries.
This article demonstrates the detailed process for connecting to Microsoft Dynamics 365 Business Central On-premise by setting up a universal HTTP connection with basic authentication and leads you through the steps required for creating imports and exports using Microsoft Dynamics 365 Business Central On-premise through REST APIs and OData APIs.
A. Prerequisites
To set up a basic auth connection to Microsoft Dynamics 365 Business Central On-premise, you have to follow the steps described below to authenticate Microsoft Dynamics 365 Business Central users with Microsoft Entra ID (sign in to Microsoft Dynamics 365 Business Central On-premises with Office 365 account)
To install the Microsoft Dynamics 365 Business Central Setup:
- From the Microsoft Dynamics Business Central Setup product releases page, install the latest version.
- Enter the client instance Business Central URL in your web browser. For example, if the client application server IP Address is
192.168.227.198
, then append theBusiness Central
instance to it:http://192.168.227.198:8080/BC171/
. Here8080
is the port number and theBC171
is the Microsoft Dynamics 365 Business Central instance. The Microsoft Dynamics 365 Business Central login page appears.
- Provide the Username and Password.
- Click Sign in.
To specify the Microsoft Office 365 account:
- In the Search bar, enter Users.
- From the search results, select Users.
- From the users list, select the required user name. The User card page appears.
- In the Office 365 authentication section, provide the user’s Microsoft Office 365 account email ID.
- Click Ok.
To register the Azure application:
- Sign in to your Azure portal.
- Navigate to Microsoft Entra ID > App registrations and click New registration. The Register an application page appears.
- Provide the Name.
- In the Supported account types section, select the required account access.
- Click Register.
- In the Essentials section, click Add an Application ID URI. The Expose an API page appears.
- In the Scopes defined by this API section, click Add a scope.
- Click Save and continue. The Application ID URI will now be generated and you can view it in the Application overview > Essentials > Application ID URI.
- Navigate to Authentication > and click Add a platform. The Configure platform panel appears.
- Click Web. The Configure web panel appears.
- In the Redirect URIs, enter the Redirect URL and click Configure.
- Navigate to the application home page to view the Primary domain.
The Microsoft Dynamics 365 Business Central application is now registered in your Azure portal and you can view the following information:
- Primary domain
- Application (client) ID
- Directory (tenant) ID
- Application ID URI
- Redirect URIs
Create and use a self-signed SSL Certificate in Windows:
- Search Windows PowerShell ISE in the search bar.
- Right-click Windows PowerShell ISE and click Run as administrator.
- Run the command (as shown in the below example) to create a new self-signed certificate. You can also see the Thumbprint. Example:
New-SelfSignedCertificate -DnsName www.yzhubc.com -CertStoreLocation cert:\LocalMachine\My
. Here you can replace the hostname.
- Navigate to Run, type in MMC, and click Ok. The Microsoft management console window appears.
- Navigate to File > Add/Remove Snap-in.
- From the available snap-ins, click Certificates and click Add. The Certificates snap-in window appears.
- Select Computer account and click Next.
- Click Finish. You can now see the issued certificate on the console page.
Assign permissions to the certificate
- Select the certificate and right-click Certificate > All tasks > Manage private keys and add permissions for the service account used to run the Microsoft Dynamics 365 Business Central Services.
Note: You can find the Service account details in Microsoft Dynamics 365 Business Central administration.
- Copy the certificate, navigate to Trusted root certification authorities and paste it.
Export and save the certificate
- Select the certificate and right-click Certificate > All tasks > Export. The Certificate export wizard window opens.
- Read the content and click Next.
- In the Export private key section, select the No, do now export the private key option, and click Next.
- In the Export file format section, select the DER encoded binary x.509 (.cer) option, and click Next.
- In the File to Export section, provide File name, click Next, and click Finish.
Add site bindings to your own hostname
- Navigate to C:\Windows\System32\drivers\etc and click hosts.
- Add a new host as shown in the image.
- Open Internet Information Services (IIS) Manager and select Microsoft dynamics 365 Business Central Web Client.
- Navigate to Actions > Edit site > Bindings > Add. The Add site binding window appears.
- From the Type dropdown list, select https.
- Enter the hostname.
- From the SSL certificate dropdown list, select your certificate and click Ok.
Configure Microsoft Dynamics 365 Business Central for Microsoft Entra ID
To configure the Microsoft Dynamics 365 Business Central server instance, you can use the administration tool, directly modify the CustomSettings.config file, or use the Set-NAVServerConfiguration cmdlet in the administration shell.
Here, we are using the Microsoft Dynamics 365 Business Central Server administration tool for demonstration.
- Open Microsoft Dynamics 365 Business Central Server and select the required instance.
- Click Edit. The Instance details page appears.
- In Certificate thumbprint, provide the Thumbprint.
- From the Credential type dropdown list, select Access control service.
- Uncheck the Disable token-signing certificate validation.
- In the Microsoft Entra ID section, provide the Application client ID.
- In WS-federation login endpoint, provide the Microsoft Dynamics 365 Business Central sign-in (client) page URL. You can use this format:
https://login.microsoftonline.com/<AAD TENANT ID><Application ID URI><Redirect URL>
- In WS-federation metadata location, provide the URL in this format:
https://login.microsoftonline.com/<Azure AD TENANT ID>/FederationMetadata/2007-06/FederationMetadata.xml
Note: The federation metadata establishes a trust relationship between Microsoft Dynamics 365 Business Central and Microsoft Entra ID.
- Click Save.
- Navigate to
C:\inetpub\wwwroot\BC171\
and open navsettings.json.
- Modify the ClientServicesCredentialType from Windows to AccessControlService.
- Restart the Microsoft Dynamics 365 Business Central instance.
Configure Client
- Navigate to
C:\Windows\System32\drivers\etc
and click hosts. - Add a new host as shown in the image.
- Open the exported certificate.
- Click Install certificate and click Ok.
Authorization
To authorize your domain in Microsoft Dynamics 365 Business Central:
- Enter your domain URL in your web browser. The Microsoft login window appears.
- Enter the email address of your registered Microsoft Dynamics 365 Business Central account.
- Click Next.
- Enter the password for your Microsoft Dynamics 365 Business Central account.
- Click Sign in.
- Review the permission and click Accept to grant permissions.
- You can now view the user authentication status as Active.
Now connect to Microsoft Dynamics 365 On-premise version using an HTTP connection in the integrator.io.
B. Set up an HTTP connection
Start establishing an HTTP connection to the Microsoft Dynamics 365 Business Central On-premise version in either of the following ways:
- From the Resources menu, select Connections. Then, click + Create connection at the top right.
– or – - While working in a new or existing integration, you can add an application to a flow simply by clicking Add source or Add destination/lookup.
In the resulting Application list, select HTTP.
The Create connection panel opens with required and advanced settings.
C. Describe the general HTTP connection settings
Edit the General settings specific to your account and this connection resource.
Name (required): Provide a clear and distinguishable name. Throughout integrator.io imports and exports, you will have the option to choose this new connection, and a unique identifier will prove helpful later when selecting among a list of connections that you’ve created.
Application (required, non-editable): A reminder of the app you’re editing.
Note: For on-premise mode, an agent must first be installed and configured. If the system you want to connect to is behind a firewall, the agent helps connect you without having to whitelist any IPs.
Mode (required): Select On-premise to connect to a server that is publicly inaccessible and has integrator.io agent installed on it.
Agent (required): Select an agent from the list. To connect to an on-premise application, integrator.io requires that an agent be installed on a networked computer. An agent is a small application that allows you to connect to data behind your firewall. When installing an agent, you will specify a unique access token, which then populates the Agent drop-down list. The installed agents connect to integrator.io and establish a reverse SSH tunnel, allowing secure communication without the need to whitelist integrator.io IP addresses in your firewall settings. A single agent can be used by multiple different connections.
D. Provide required HTTP account information
Note: This article is concerned only with the settings needed for the Microsoft Dynamics 365 Business Central On-premise connection. For complete field documentation, see Set up a basic auth HTTP connection.
At this point, you’re presented with a series of options for providing HTTP authentication.
Base URI (required): Enter the hostname in this format: http://hostname:port no/instance name
. For example: http://www.hpbconprem.com:7048/BC140/
Media type (required): Select JSON.
Override media type for success responses: Accept the default value: Do not override.
Override media type for error responses: Accept the default value: Do not override.
E. Configure authentication settings
In the Configure authentication section, select Basic and configure the authentication.
Auth type (required): Select Basic. The settings then become specific to basic auth. At a minimum, you must provide your username and password to establish a connection.
Username (required): Enter the basic authentication username of a user.
Password (required): Enter the Web access key of the user. Multiple layers of protection are in place, including AES 256 encryption, to keep your connection’s password safe. When editing this form later, you must enter this value again; it is stored only when the connection is saved and never displayed as text.
F. Specify how to test this connection
Expand the How to test this connection? section.
HTTP method: Select GET.
Relative URI: Enter the relative URI in this respective format:
-
REST API:
/api/v1.0/entityDefinitions
. For example:/api/v1.0/companies
. -
OData API:
/ODataV4/entityDefinitions
. For example:/ODataV4/Company
.
G. Test the connection
Once you have configured the HTTP connection, you have a few options for continuing:
- Save – click this button to test the connection, and commit the new connection so that it will be available to all integrations for your account
- Save & close – click to test and save the connection and exit the Create connection panel
- Close – click to exit without saving any new changes
- Test connection – click this button to verify that your new connection is free of errors
When you test or save the connection, it is verified before continuing.
If the connection fails, double-check the provided settings, and test again.
H. Exports
Here is an example of how to configure the export using the Get Companies operation for Microsoft Dynamics Business Central On-premise API and extract data from Microsoft Dynamics Business Central On-premise.
The relative URI of REST API: /api/v1.0/entityDefinitions
.
I. HTTP Import
Here is an example on how to configure the import for Microsoft Dynamics Business Central On-premise API and import data out of Microsoft Dynamics Business Central On-premise.The relative URI of REST API: /api/v1.0/companies(CompanyiD)/customers
.
Comments
Please sign in to leave a comment.