## Microsoft Dynamics 365 Business Central integration Integrating Microsoft Dynamics 365 Business Central with Frontegg allows your application to read and manage the signed-in user's Business Central data — companies, customers, items, sales and purchase orders, invoices, journals, financial accounts, dimensions, and tax groups — through Frontegg's integration layer using Microsoft OAuth 2.0 and the Business Central REST API v2.0. Prerequisites - A Microsoft Entra (Azure AD) tenant with at least the **Application Developer** role - A Microsoft Dynamics 365 Business Central environment (Production or Sandbox) provisioned in the same tenant - The **Directory (tenant) ID** for that tenant ### Register an application in Microsoft Entra #### Step 1: Open App registrations Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com/) and navigate to **Entra ID → App registrations**. Click **New registration**. ![App registrations page in Microsoft Entra admin center](/assets/microsoft-business-central-1.706c058e33162dd428bd7ae67060ce021e56098208e4f010763dd1031eba797a.1ce25488.png) #### Step 2: Register a new application Fill in the registration form: 1. Enter a name for your application (for example, `Frontegg Business Central Integration`). 2. Under **Supported account types**, select **Accounts in this organizational directory only (single tenant)**. Business Central REST endpoints embed your tenant ID directly, so single-tenant is the correct choice. 3. Under **Redirect URI**, select **Web** as the platform and enter your Frontegg Redirect URL: ``` https://YOUR_MCP_GATEWAY_URL/integration-callback ``` 4. Click **Register**. ![New application registration form with name, account type, and redirect URI filled in](/assets/microsoft-business-central-2.49dd57fd24acae021063f44d3ab062b9c232809addce763cf3ff4ff5b2e2ba33.1ce25488.png) #### Step 3: Copy the Application (client) ID and Directory (tenant) ID After registration, you are taken to the application **Overview** page. Copy both the **Application (client) ID** and the **Directory (tenant) ID** — you will need them when configuring the Frontegg portal. ![Application overview page with Application (client) ID and Directory (tenant) ID highlighted](/assets/microsoft-business-central-3.24fcccd9c068334f3320daf21aef9ffc1e02f53810f66be2b6ea8a5275f335e0.1ce25488.png) ### Configure API permissions #### Step 4: Add a permission In the left sidebar, click **API permissions**, then click **Add a permission**. On the **Microsoft APIs** tab, scroll down under **More Microsoft APIs** and select **Dynamics 365 Business Central**. ![Request API permissions panel with Dynamics 365 Business Central highlighted](/assets/microsoft-business-central-4.28f5a76d0bb16f2784fde69f6c60d9efc8c4858de75daff94756476aba45b9c3.1ce25488.png) #### Step 5: Select delegated permissions Click **Delegated permissions**. Select both of the following scopes, then click **Add permissions**: | Scope | Description | | --- | --- | | `user_impersonation` | Access Business Central as the signed-in user | | `Financials.ReadWrite.All` | Read and write all Business Central financial data the user can access | ![Delegated permissions list with user_impersonation and Financials.ReadWrite.All selected](/assets/microsoft-business-central-5.9c0a3bfc86ce0733625231a7948ea590c13027e018f0921ddfbf32a03f670f2d.1ce25488.png) #### Step 6: Grant admin consent On the **API permissions** page, click **Grant admin consent for {your directory}** and confirm. Both Business Central scopes show as configured under **Dynamics 365 Business Central**. ![Configured permissions list showing Business Central scopes](/assets/microsoft-business-central-6.31e0803f82bf509f252947ad66b3efc03e0f1947cea04c79a2c766e3aaf5c349.1ce25488.png) ### Create a client secret #### Step 7: Open Certificates & secrets In the left sidebar, click **Certificates & secrets**, then on the **Client secrets** tab click **New client secret**. ![Certificates and secrets page with New client secret button highlighted](/assets/microsoft-business-central-7.06aafc48198389d8bba6d9a0326034720d9cc8c3d3b8637a3c7df3313ae5a5ce.1ce25488.png) #### Step 8: Add a description and expiry In the **Add a client secret** panel, enter a description (for example, `Frontegg Integration Secret`), choose an expiry period, and click **Add**. ![Add a client secret panel with description filled in](/assets/microsoft-business-central-8.f28230bcc47caf5e2f83a20a37d719d8e618edd57a611f7e2a97a9508562c08e.1ce25488.png) #### Step 9: Copy the client secret value The new secret appears in the list. Copy the **Value** immediately — it is only displayed once. After you navigate away, you cannot retrieve it again. Save your Client Secret now The Client Secret value is only displayed once. After you leave this page, you can only see the Secret ID — not the value. Store the value securely before continuing. ![Client secret list showing the newly created secret](/assets/microsoft-business-central-9.abb3505ce135697ab9a8e62a8d59367d5a00901fa8497ae86c410363df183a2c.1ce25488.png) ### Identify your Business Central environment Business Central REST URLs embed two per-tenant identifiers in addition to the Directory (tenant) ID: the **environment name** and (optionally) a default **company ID**. #### Step 10: Find your environment name Open the [Business Central admin center](https://businesscentral.dynamics.com/admin) and go to the **Environments** page. Each row lists the environment **Name** (for example, `Production` or `Sandbox`) and its **Type**. Use the name exactly as shown — it is case-sensitive. #### Step 11: (Optional) Find your default company ID Sign in to [Business Central](https://businesscentral.dynamics.com/) and switch to the company you want as the default. The company ID is a GUID returned by the `/companies` endpoint of the Business Central REST API — you can call `GET https://api.businesscentral.dynamics.com/v2.0///api/v2.0/companies` to list all companies and their IDs. Leave this field empty in Frontegg to require `companyId` on every tool call. ### Configure the Frontegg portal Once you have your **Client ID**, **Client Secret**, **Directory (tenant) ID**, and **environment name**, enter them in the Frontegg portal: 1. Open the **Frontegg portal** and navigate to [ENVIRONMENT] → Integrations → Microsoft Dynamics 365 Business Central. 2. Enter the **Client ID** and **Client Secret** from your Entra app registration. 3. Enter the **Directory (tenant) ID** (for example, `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`). 4. Enter the **Business Central environment** name (for example, `Production`). 5. (Optional) Enter the **Default company ID** GUID. 6. The **Base URL** auto-populates as `https://api.businesscentral.dynamics.com/v2.0///api/v2.0`. 7. Click **Save**. Keep your credentials secure Never share or commit your Client Secret to version control. ### Additional resources - [Business Central REST API v2.0 documentation](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/) - [Register an application in Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app) - [Connect Business Central to non-Microsoft MCP clients](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/ai/use-mcp-server-non-microsoft) - [Microsoft Entra admin center](https://entra.microsoft.com/) - [How to get your Redirect URL](/agen-for-work/connectors/redirect-url)