This information is for Microsoft Dynamics Business Central versions 17 and higher.
Overview
This guide provides instructions on installing the AGR Data Integrator for BC. The extension is fully integrated with Microsoft Dynamics 365 Business Central and is certified by App Source, which guarantees that it meets the strictest quality standards required by Microsoft.
The solution creates REST APIs to connect to AGR and allows BC to seamlessly send and receive data between the two programs.
Using OAuth or Basic Auth through Azure provides authentication. The endpoints created can be found in BC after installation by opening the Web Services page and filtering on AGR.
1. Installation
Download the AGR Data Integrator file for your BC version below, and install it into Business Central.
Once the status for the app in Extension Management reads installed, it can be set up to communicate with AGR Essentials. To finish setting up the AGR Data Integrator, make sure to have all necessary connection information on hand.
2. Setup
The AGR Data Integrator can be set up through the AGR Data Integrator page in BC.
2.1 Order Creation (Optional)
Purchase Order No. Series:
This field determines Number Series used when purchase orders are created from AGR orders. If left empty, purchase orders will be created according to the default logic defined in the Purchases & Payables setup in Business Central. If needed, you can override the numbers series used for creating purchase orders by selecting a value from the dropdown.
Transfer Order No. Series
This is the Number Series used when transfer orders are created from AGR Orders. You can either create a new number series for AGR Orders or use the number series that is defined in the Inventory setup.
Route order info to Req. Wrksht
When AGR orders are sent to BC, the process works as follows:
Orders are imported from AGR into the AGR Import Lines page in BC, a feature provided by the AGR Data Integrator app.
The AGR Import Lines are then transferred into a Requisition Worksheet.
The Requisition Worksheet is processed, creating Purchase or Transfer Orders.
By enabling this option, step 3 is bypassed. This means the imported orders will remain as lines in the Requisition Worksheet, allowing users to make adjustments within the BC planning workspace before finalizing them as actual orders.
3. Configure OAuth authentication
AGR supports OAuth and basic authentication!
If you are unable to configure OAuth authentication for BC on-premise, you can skip this step and create Basic authentication credentials instead. See 3. Configure Basic authentication (alternative).
AGR uses Service-to-Service (S2S) Authentication to integrate with Business Central. You can read more about S2S Authentication in a Microsoft article that provides more details on the information below.
3.1. Register the app in Azure
In the Azure portal, find and open App Registrations
2. Select New registration.
3. Fill in the details as pictured below and select Register at the bottom of the page
4. Find the newly created app registration.
5. Open the overview page.
6. Copy the Application (client) ID and store it for later.
3.1.1 Create a client secret
Select Certificates & Secrets on the left.
Select New client secret.
Give the secret a description and an expiry date
Click on Add.
Copy the value and store it. You will need to give AGR this value.
Note!
This is the only time the secret is visible, so copy it now. Once the secret expires, AGR will no longer have access to BC and you will need to create a new client secret.
3.1.2 Grant API permissions
Select API permissions on the left.
Select Add a permission.
Find Dynamics 365 Business Central.
Select Application Permissions.
Under API, select API.ReadWrite.All.
Select Add permissions to apply the changes.
Select Grant admin consent to apply consent
3.1.3 Add a redirect URI
Select Authentication on the left.
Set a Redirect URL. The default is to add both https://api.businesscentral.dynamics.com and https://businesscentral.dynamics.com. These values may differ depending on the business setup.
3.2. Permissions in BC
The next step is to provide permissions through Business Central.
Open the Microsoft Entra Applications (previously named Azure Active Directory Application) in BC.
2. Click new.
3. Provide a description, such as AGR authentication.
4. Set the Client ID as the Application (client) ID from the app registration created previously. You can find the value again by going to the Azure portal > App registrations and opening the app.
5. At the bottom of the screen in User Permission Sets, provide the permission set ORI AGR DATA INTEGR and select the Company Name that AGR will connect to.
Note
For BC 17 or older, permission set ORI AGR DATA INTEGR does not apply. Instead, add the following permission sets: AGR Data Integrator, D365 BASIC, D365 PURCH DOC (Edit), D365PREM MFG (Edit), D365 WHSE (View), Inventory Transfer (Edit), Receivables Documents (View)
The page should look something like this after it has been set up.
3. Configure Basic authentication (alternative)
Important
This step is an alternative to step 3. Configure OAuth authentication, for scenarios where Oauth authentication cannot be configured. If you have already configured Oauth, you can skip this step.
To configure Basic authentication for AGR to access BC, add a new user to BC and add the ORI AGR DATA INTEGR permission set to the user:
3.1 BC instance configuration?
It is important that the BC instance is connected to the Live BC database, and that it has the following configuration:
Credential Type: NavUserPassword
Enable Add-in Annotations: True
Enable API Services: True
Enable OData Services: True
4. Provide AGR with the needed information
Provide the following information to AGR. You can send this via email to your AGR contact with the subject "OAuth information to connect AGR to BC".
Be careful when sharing sensitive data, e.g. passwords. When sharing via email, we recommend generating a one-time link using 1ty.me.
The Application (client) ID of the app, created in step 3.1
If using Basic authentication, then send User Name instead
The Secret value from step 3.1.1
If using Basic authentication, then send password instead
Copy and send the values that are shown when Show Order API URL and Show Item API URL are clicked on the AGR Data Integrator page in BC.