Articles in this section

Set up a basic auth HTTP connection to Microsoft Dynamics 365 Business Central On-premise

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:

  1. From the Microsoft Dynamics Business Central Setup product releases page, install the latest version.
  2. 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 the Business Central instance to it: http://192.168.227.198:8080/BC171/ . Here 8080 is the port number and the BC171 is the Microsoft Dynamics 365 Business Central instance. The Microsoft Dynamics 365 Business Central login page appears.
1.png
  1. Provide the Username and Password.
  2. Click Sign in.
2.png

To specify the Microsoft Office 365 account:

  1. In the Search bar, enter Users.
  2. From the search results, select Users.
3.png
  1. From the users list, select the required user name. The User card page appears.
4.png
  1. In the Office 365 authentication section, provide the user’s Microsoft Office 365 account email ID.
  2. Click Ok.
5.png

To register the Azure application:

  1. Sign in to your Azure portal.
  2. Navigate to Microsoft Entra ID > App registrations and click New registration. The Register an application page appears.
6.png
  1. Provide the Name.
  2. In the Supported account types section, select the required account access.
  3. Click Register.
7.png
  1. In the Essentials section, click Add an Application ID URI. The Expose an API page appears.
8.png
  1. In the Scopes defined by this API section, click Add a scope.
  2. 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.
9.png
  1. Navigate to Authentication > and click Add a platform. The Configure platform panel appears.
  2. Click Web. The Configure web panel appears.
10.png
  1. In the Redirect URIs, enter the Redirect URL and click Configure.
11.png
  1. Navigate to the application home page to view the Primary domain.
12.png

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:

  1. Search Windows PowerShell ISE in the search bar.
  2. Right-click Windows PowerShell ISE and click Run as administrator.
13.png
  1. 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.
14.png
  1. Navigate to Run, type in MMC, and click Ok. The Microsoft management console window appears.
  2. Navigate to File > Add/Remove Snap-in.
15.png
  1. From the available snap-ins, click Certificates and click Add. The Certificates snap-in window appears.
16.png
  1. Select Computer account and click Next.
  2. Click Finish. You can now see the issued certificate on the console page.
17.png

Assign permissions to the certificate

  1. 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.

18.png
19.png
  1. Copy the certificate, navigate to Trusted root certification authorities and paste it.
20.png
21.png

Export and save the certificate

  1. Select the certificate and right-click Certificate > All tasks > Export. The Certificate export wizard window opens.
  2. Read the content and click Next.
22.png
  1. In the Export private key section, select the No, do now export the private key option, and click Next.
  2. In the Export file format section, select the DER encoded binary x.509 (.cer) option, and click Next.
22.png
  1. In the File to Export section, provide File name, click Next, and click Finish.

Add site bindings to your own hostname

  1. Navigate to C:\Windows\System32\drivers\etc and click hosts.
  2. Add a new host as shown in the image.
24.png
  1. Open Internet Information Services (IIS) Manager and select Microsoft dynamics 365 Business Central Web Client.
  2. Navigate to Actions > Edit site > Bindings > Add. The Add site binding window appears.
25.png
  1. From the Type dropdown list, select https.
  2. Enter the hostname.
  3. From the SSL certificate dropdown list, select your certificate and click Ok.
26.png

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.

  1. Open Microsoft Dynamics 365 Business Central Server and select the required instance.
  2. Click Edit. The Instance details page appears.
27.png
  1. In Certificate thumbprint, provide the Thumbprint.
  2. From the Credential type dropdown list, select Access control service.
  3. Uncheck the Disable token-signing certificate validation.
28.png
  1. In the Microsoft Entra ID section, provide the Application client ID.
  2. 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>
  3. 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.

  4. Click Save.
29.png
  1. Navigate to C:\inetpub\wwwroot\BC171\and open navsettings.json.
30.png
  1. Modify the ClientServicesCredentialType from Windows to AccessControlService.
  2. Restart the Microsoft Dynamics 365 Business Central instance.
31.png

Configure Client

  1. Navigate to C:\Windows\System32\drivers\etc and click hosts.
  2. Add a new host as shown in the image.
32.png
  1. Open the exported certificate.
  2. Click Install certificate and click Ok.
33.png

Authorization

To authorize your domain in Microsoft Dynamics 365 Business Central:

  1. Enter your domain URL in your web browser. The Microsoft login window appears.
  2. Enter the email address of your registered  Microsoft Dynamics 365 Business Central account.
  3. Click Next.
  4. Enter the password for your Microsoft Dynamics 365 Business Central account.
  5. Click Sign in.
  6. Review the permission and click Accept to grant permissions.
34.png
  1. You can now view the user authentication status as Active.
36.png

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.

List.png

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.

DEtails.png

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.

Provide.png

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.

Provide2.png

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.

Provide3.png

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.

Test.png

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.

Import1.png
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.