# Setting up Dynamics Business Central as your agnoStack CRM Provider

Connect Microsoft Dynamics 365 Business Central to agnoStack in Zendesk: register an Azure AD application, authorize it in Business Central, then enter your Tenant ID, Client ID and Client secret.

![agnoStack CRM Providers with the Business Central Tenant ID, Client ID and Client secret fields](https://go.agnostack.com/images/configuration/dynamics-business-central/configuration-dynamics-businesscentral-screenshot.png)

*The Dynamics Business Central configuration screen in agnoStack.*

[Microsoft Dynamics Business Central](https://dynamics.microsoft.com/en-us/business-central/overview/) can be integrated with Zendesk as a free [Add-On Provider](https://agnostack.com/faqs/setup-onboarding/choose-optional-add-ons#add-on-providers) through agnoStack.

Microsoft Dynamics 365 Business Central is an **ERP/CRM solution** that provides cloud-based business management software, bringing your business data into one system and giving every department a unified view of the overall business.

To connect Business Central, you'll need three values from an Azure Active Directory (Azure AD) application: a **Tenant ID**, a **Client ID** and a **Client secret**. Follow the steps below to create the application, authorize it in Business Central and grant it API access.

## Create and Register an Azure AD Application

1. Sign in to the [Azure portal](https://portal.azure.com) (`https://portal.azure.com`) using the same Admin credentials you use to access Business Central.

   ![Azure portal search showing App registrations](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-azure-1.png)

   *Searching for App registrations in the Azure portal.*

2. Click **New registration** to register your new application.

   ![Azure App registrations with the New registration button](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-azure-register-2.png)

   *App registrations in the Azure portal.*

3. Give your application a meaningful name (this can be anything you wish), make sure to select the **Single tenant** option, then click **Register**.

   ![Azure Register an application form](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-azure-register-3.png)

   *Registering a new application.*

4. Once your application is registered, make a note of the **Application (client) ID** (your **Client ID**) and the **Directory (tenant) ID** (your **Tenant ID**). You'll need both later to configure agnoStack.

   ![Azure app registration overview with the Application (client) ID and Directory (tenant) ID](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-azure-register-4.png)

   *The app registration overview.*

5. Click **Certificates & secrets** in your app registration's left-hand menu. Choose **New client secret**, give it a description and select an expiration duration (we recommend 24 months).

   ![Azure Add a client secret panel](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-azure-secret-5.png)

   *Adding a client secret.*

6. Once your client secret is created, copy its value. This is your **Client secret**.

   ![Azure Certificates and secrets with the new client secret value](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-azure-secret-6.png)

   *Copying the client secret.*

> **Note:** Copy your client secret immediately, as it is only displayed once. You'll need this value later to configure agnoStack.

## Set Up the Azure AD Application in Business Central

1. Log in to your Business Central account using your Admin credentials. In the main search field, type *Azure Active Directory Applications* and select this option in the search results.

   ![Business Central search results for Azure Active Directory Applications](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-dashboard-7.png)

   *Searching for Azure Active Directory Applications in Business Central.*

2. Click **New** to add your new application to Business Central.

   ![Business Central Azure Active Directory Applications with the New button](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-dashboard-8.png)

   *Adding a new application.*

3. Enter the **Client ID** you noted earlier, give it a description and set **State** to **Enabled**. Then scroll down to the **User Groups** section to add the appropriate permissions.

   ![Business Central Azure Active Directory Application Card](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-application-9.png)

   *The Azure Active Directory Application Card.*

4. Click inside the **Code** field to open the permission list and choose the appropriate permissions. The minimum permission agnoStack needs is **D365 BASIC ISV**.

   ![Business Central permission list with D365 BASIC ISV](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-application-10.png)

   *Choosing the application's permissions.*

5. Once selected, click into the **Name** field to make sure its value is populated. Your configuration should then look like the screenshot below.

   ![Business Central application card with the D365 BASIC ISV permission configured](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-application-11.png)

   *The configured application permission.*

6. Go back to your **Business Central dashboard**, select the **Gear** icon and choose **Admin Center** to authorize your new application.

   ![Business Central settings menu with Admin Center](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-admincenter-12.png)

   *Opening the Admin Center from the settings menu.*

7. Choose **Authorized AAD Apps**, then click **Authorize Azure AD app** at the top of the screen. In the **Application (Client) ID** field, enter your **Client ID** and click **Save**.

   ![Business Central Admin Center authorizing an Azure AD app](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-admincenter-13.png)

   *Authorizing the Azure AD application.*

> **Note:** You don't need to click the Grant link that appears in the list once saved. You'll grant consent in the Azure portal in the next section.

## Configure the Azure AD Application Permissions

1. Go back to the [Azure portal](https://portal.azure.com) (`https://portal.azure.com`) and open your new app registration. You can find it by searching for *App registrations* and selecting your application from the list.
2. On your application's overview screen, click **API permissions** in the left-hand menu. In the **Request API permissions** panel, click **Dynamics 365 Business Central**.

   ![Azure Request API permissions with Dynamics 365 Business Central](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-azure-permissions-14.png)

   *Selecting the Dynamics 365 Business Central API.*

3. Scroll down, select the **API.ReadWrite.All** permission and click **Add permissions**.

   ![Azure Request API permissions with API.ReadWrite.All selected](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-azure-permissions-15.png)

   *Adding the API.ReadWrite.All permission.*

4. Finally, click **Grant admin consent for [your domain]**. Everything is now configured.

   ![Azure API permissions with Grant admin consent](https://go.agnostack.com/images/configuration/dynamics-business-central/onboarding-dynamics-bc-azure-permissions-16.png)

   *Granting admin consent.*

## Entering Your Credentials in agnoStack

In Zendesk, open the agnoStack configuration panel (via the **Manage Your Account** link or the icon in the left sidebar) and, under **CRM Providers**, select **Business Central**. Then enter the following:

| Field | Value |
| --- | --- |
| Tenant ID | The **Directory (tenant) ID** of your Azure app registration |
| Client ID | The **Application (client) ID** of your Azure app registration |
| Client secret | The client secret value you copied |

Continue through the remainder of the configuration screens and click **Activate** to save your new configuration.

If you run into any trouble or need additional assistance, please contact us any time at [support@agnostack.com](mailto:support@agnostack.com).
