> ## Documentation Index
> Fetch the complete documentation index at: https://integrations.docs.commenda.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Dynamics 365 Business Central

> Learn how to set up our Microsoft Dynamics 365 Business Central integration.

If you wish to set up Microsoft Dynamics 365 Business Central on the RootFi Portal, you will need to follow the steps outlined below.

<Note>You will need to have verified your company domain in order for you to link your Microsoft Dynamics 365 Business Central integration</Note>

<Steps titleSize="h2">
  <Step title="Create an App" stepNumber="1">
    Follow the link [https://portal.azure.com/#view/Microsoft\_AAD\_RegisteredApps/ApplicationsListBlade](https://portal.azure.com/#view/Microsoft%5FAAD%5FRegisteredApps/ApplicationsListBlade)

    Click on the +New Registration, you will see a form like this.

    <img src="https://mintcdn.com/rootfi-commenda/Ww3YPpDlQzbumiZY/images/a5c5a30-Screenshot_2973.png?fit=max&auto=format&n=Ww3YPpDlQzbumiZY&q=85&s=a028e7eff6c0db308581be398dbf6e4b" alt="" width="1920" height="877" data-path="images/a5c5a30-Screenshot_2973.png" />

    1. Enter the user-facing display name for this application (this can be changed later).
    2. Select Supported account types: Select Accounts in any organisational directory (Any Azure AD directory - Multi-tenant) and personal Microsoft accounts (e.g. Skype, Xbox). This allows RootFi to access data in Dynamics 365 Business Central.
    3. In the Redirect URI, select the dropdown value as Web and in the value, paste the url, [ROOTFI CALLBACK URL](/api-reference/v3/overview/environments#callback-urls)
    4. Now Click the Register Button, now you have created an app.
    5. Below, You can see the newly created app.

    ***
  </Step>

  <Step title="Copy Client ID and Client Secret" stepNumber="2">
    1. Click on the newly created app, Go to the Overview section, you can see the Application Client ID.

           <img src="https://mintcdn.com/rootfi-commenda/Ww3YPpDlQzbumiZY/images/65ad5f0-Screenshot_2962.png?fit=max&auto=format&n=Ww3YPpDlQzbumiZY&q=85&s=8191747c7a4c99e96b7bcbe082fd7cf1" alt="Client ID MS Dynamics" width="1920" height="883" data-path="images/65ad5f0-Screenshot_2962.png" />

    ***
  </Step>

  <Step title="Generate and retrieve your client secret" stepNumber="3">
    In the Azure Portal:

    1. Select Certificates & secrets in the left menu.
    2. Under Client secrets, click New client secret.
    3. In the Add a client secret dialogue, update the following information:
    4. Description: Enter a short description of your client secret to make it easier to find.\
       Expires: Select the most appropriate option that complies with your company's security policy.\
       Click Add.

    Your **client secret** is generated and displayed at the bottom of the page.

    <Tip>
      **Important**
      The secret value won't be displayed again in full, so you must copy the value as soon as it gets generated.
    </Tip>

    ***
  </Step>

  <Step title="Update access permissions" stepNumber="4">
    Now update the access permissions for your application. These control the data that your app can access in Business Central.

    1. Select API permissions in the left menu.
    2. Under Configured permissions, click Add permission.
    3. In the Request API permissions pane, scroll down and select Dynamics 365 Business Central.
    4. Select Application permissions and also select the listed permissions:\
       **AdminCenter.ReadWrite.All**, **API.ReadWrite.All**, **app\_access** and **Automation.ReadWrite.All**.
           <img src="https://mintcdn.com/rootfi-commenda/JIWggfJznJdOtanp/images/msdBc/permissions.png?fit=max&auto=format&n=JIWggfJznJdOtanp&q=85&s=4c396c8487ecc6baa6c34367c9ee5355" alt="Permissions" width="1998" height="512" data-path="images/msdBc/permissions.png" />
    5. Click 'Add Permissions'.
    6. Above the listed permissions, select Grant admin consent for Default Directory and then select Yes to confirm your change. This option might not be available for all subscription types
           <img src="https://mintcdn.com/rootfi-commenda/JIWggfJznJdOtanp/images/msdBc/grant.png?fit=max&auto=format&n=JIWggfJznJdOtanp&q=85&s=703ff9aad8399023778b32f611cb9df8" alt="Permissions Grant" width="978" height="262" data-path="images/msdBc/grant.png" />

    ***
  </Step>

  <Step title="Enable the App Inside Business Central" stepNumber="5">
    To complete your setup, enable the Azure Entra App **from within Business Central**:

    Navigate to the following link and sign into
    [https://businesscentral.dynamics.com](https://businesscentral.dynamics.com)

    1. Click the **search icon** (🔍) in the top-right corner, search for **“Entra”**, and click **Microsoft Entra Applications**:
           <img src="https://mintcdn.com/rootfi-commenda/K9cWVVWicIUdzprd/images/msdBc/entraSearch.png?fit=max&auto=format&n=K9cWVVWicIUdzprd&q=85&s=15f49dccf56a74263b11cc208d5f5c69" alt="Search Entra Applications" width="2686" height="1684" data-path="images/msdBc/entraSearch.png" />
    2. Click **New**.
           <img src="https://mintcdn.com/rootfi-commenda/iOGR2Lltsy8EHszS/images/msdBc/createNewEntra.png?fit=max&auto=format&n=iOGR2Lltsy8EHszS&q=85&s=3ac2517b6f92c802351a9458b400b562" alt="Create New Entra" width="2253" height="271" data-path="images/msdBc/createNewEntra.png" />
    3. In the form that appears, paste your **Client ID** into the **Client ID / App ID** field.
           <img src="https://mintcdn.com/rootfi-commenda/iOGR2Lltsy8EHszS/images/msdBc/fillEntraForm.png?fit=max&auto=format&n=iOGR2Lltsy8EHszS&q=85&s=176f306ee2b4f1d56bb09764db7b35f0" alt="Fill Entra App Form Fields" width="2660" height="1456" data-path="images/msdBc/fillEntraForm.png" />
    4. From the **State** dropdown, select **Enabled**.
    5. Scroll down to the permissions section and assign **Administrator** access.
           <img src="https://mintcdn.com/rootfi-commenda/iOGR2Lltsy8EHszS/images/msdBc/addEntraPermissionSet.png?fit=max&auto=format&n=iOGR2Lltsy8EHszS&q=85&s=f8dbba73629bb62c9a6d0f0eece37caa" alt="Enable Administrator Permission" width="2358" height="260" data-path="images/msdBc/addEntraPermissionSet.png" />
    6. Click **Save** to apply the changes.
           <img src="https://mintcdn.com/rootfi-commenda/iOGR2Lltsy8EHszS/images/msdBc/saveEntraForm.png?fit=max&auto=format&n=iOGR2Lltsy8EHszS&q=85&s=cd821b723ad55724b26184a2eea61a4c" alt="Save Entra Form" width="2660" height="1966" data-path="images/msdBc/saveEntraForm.png" />
    7. Your Azure App is now authorized inside Business Central and ready for use with RootFi.

    ***
  </Step>

  <Step title="Get Tenant ID and Env Name from Admin Center" stepNumber="6">
    You will need to enter your Client Credentials, Tenant ID and Env name in the RootFi connect screen.

    1. To get the Tenant ID and Env name, navigate to the BC dashboard, click on settings and then click on 'Admin Center'.
           <img src="https://mintcdn.com/rootfi-commenda/JIWggfJznJdOtanp/images/msdBc/admin_center.png?fit=max&auto=format&n=JIWggfJznJdOtanp&q=85&s=594e4c20f3f0df0194a23f51a43c90f5" alt="Client ID MS Dynamics" width="471" height="471" data-path="images/msdBc/admin_center.png" />
    2. Select the environment you want to connect.
           <img src="https://mintcdn.com/rootfi-commenda/JIWggfJznJdOtanp/images/msdBc/envs.png?fit=max&auto=format&n=JIWggfJznJdOtanp&q=85&s=e179e2d909beb4d9416fe1cda94b8f2e" alt="Client ID MS Dynamics" width="1636" height="450" data-path="images/msdBc/envs.png" />
    3. Copy the name of the environment and the tenant id from the URL. Use the following pattern to get the tenant ID of your Business Central: [https://businesscentral.dynamics.com/\[TENANT\_ID\]/\[ENVIRONMENT\_NAME](https://businesscentral.dynamics.com/\[TENANT_ID]/\[ENVIRONMENT_NAME)]
           <img src="https://mintcdn.com/rootfi-commenda/JIWggfJznJdOtanp/images/msdBc/env_name_tenant.png?fit=max&auto=format&n=JIWggfJznJdOtanp&q=85&s=53ba9d118f1326c07972714cd032d7eb" alt="Client ID MS Dynamics" width="1643" height="484" data-path="images/msdBc/env_name_tenant.png" />

    ***
  </Step>
</Steps>
