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

# Dynamics 365

> Connect BonData to Microsoft Dynamics 365 CRM

Microsoft Dynamics 365 is an enterprise suite of CRM and ERP applications for sales, customer service, finance, and operations. With BonData, you can connect to your Dynamics 365 environment to read, enrich, and sync your business data within Agent workflows.

BonData supports two authentication methods for Dynamics 365.

<CardGroup cols={2}>
  <Card title="OAuth Authentication" icon="shield-check" href="#oauth-authentication">
    For user-delegated access
  </Card>

  <Card title="Application User" icon="robot" href="#application-user">
    For service-to-service integration
  </Card>
</CardGroup>

***

## OAuth Authentication

Follow these steps to configure OAuth authentication for BonData.

### Step 1: Register an App in Azure AD

1. Go to [Azure Portal](https://portal.azure.com/)
2. Navigate to **Azure Active Directory** → **App registrations**
3. Click **New registration**
4. Configure:
   * **Name**: `BonData Integration`
   * **Supported account types**: Accounts in any organizational directory
   * **Redirect URI**: Web - `https://app.bondata.ai/auth/oauth2/callback`
5. Click **Register**

### Step 2: Configure API Permissions

1. Go to **API permissions** → **Add a permission**
2. Select **Dynamics CRM**
3. Choose **Delegated permissions** and select `user_impersonation`
4. Click **Add permissions**
5. Click **Grant admin consent** (requires admin)

### Step 3: Create Client Secret

1. Go to **Certificates & secrets** → **Client secrets**
2. Click **New client secret**
3. Add a description and select expiration
4. **Copy the secret value immediately** - it won't be shown again

### Step 4: Note Your Credentials

* **Client ID**: Found on the Overview page (Application ID)
* **Client Secret**: The value you just copied

### Step 5: Get Your Dynamics URL

Your Dynamics 365 URL is in the format:

* `https://yourorg.crm.dynamics.com`

### Step 6: Enter Credentials

Enter your Dynamics URL in BonData, then click Connect to authorize via OAuth.

### Required Fields (OAuth)

| Field | Description                       |
| ----- | --------------------------------- |
| URL   | Your Dynamics 365 environment URL |

***

## Application User

Follow these steps to create an application user for BonData.

### Step 1: Register an App in Azure AD

1. Go to [Azure Portal](https://portal.azure.com/)
2. Navigate to **Azure Active Directory** → **App registrations**
3. Click **New registration**
4. Enter a name (e.g., `BonData Integration`)
5. Select **Accounts in this organizational directory only**
6. Click **Register**

### Step 2: Get App Credentials

1. Note the **Application (client) ID** - this is your Client ID
2. Note the **Directory (tenant) ID** - this is your Tenant ID
3. Go to **Certificates & secrets** → **Client secrets**
4. Click **New client secret**
5. Add a description and select expiration
6. **Copy the secret value immediately** - it won't be shown again

### Step 3: Create Application User in Dynamics

1. Go to [Power Platform Admin Center](https://admin.powerplatform.microsoft.com/)
2. Select your environment → **Settings** → **Users + permissions** → **Application users**
3. Click **New app user**
4. Add the app you registered
5. Assign appropriate security roles

### Step 4: Get Your Dynamics URL

Your Dynamics 365 URL is in the format:

* `https://yourorg.crm.dynamics.com` (North America)
* `https://yourorg.crm4.dynamics.com` (EMEA)

### Step 5: Enter Credentials

Enter your Tenant ID, Client ID, Client Secret, and Dynamics URL in BonData.

### Required Fields (Application User)

| Field         | Description                                            |
| ------------- | ------------------------------------------------------ |
| Tenant ID     | Directory (tenant) ID from Azure AD app registration   |
| Client ID     | Application (client) ID from Azure AD app registration |
| Client Secret | Client secret from Azure AD app registration           |
| URL           | Your Dynamics 365 environment URL                      |
