How to connect Dynamics 365 to Composio

3 min read

Composio connects AI agents to Dynamics 365 so they can work with CRM records and business data. Access is limited by the permissions you approve and your account’s existing access.

This guide shows you how to set up OAuth credentials and connect Dynamics 365 to Composio.

Part 1: Create your Microsoft Entra OAuth app

Step 1: Register the app

1. Open Azure portal → App registrations → New registration. Name the app and choose the organizational accounts you want to support.

2. Select Web, register the callback below and click Register.

https://backend.composio.dev/api/v1/auth-apps/add

Microsoft Entra app registration

Step 2: Copy the client ID and create a secret

1. Copy the Application (client) ID from Overview.

App overview with private identifiers censored

2. Open Certificates & secrets → New client secret.

New client secret button

3. Enter a description, choose an expiry and click Add.

Secret description and expiry

4. Copy and securely store the secret Value. Use the Value, not the Secret ID. Rotate it before expiry.

Secret Value censored

Step 3: Add the Dynamics delegated permission

1. Open API permissions → Add a permission.

API permissions navigation

2. Select Dynamics CRM.

Dynamics CRM API picker

3. Choose Delegated permissions. Choose the delegated permissions needed for the operations your integration will use. Then click Add permissions.

Permission reference. The delegated Dynamics data permission is user_impersonation, scoped to your environment. offline_access supports continued access. The signed-in user's Dynamics security roles still determine record access. Choose permissions for your own workflow; the screenshots are examples. Microsoft permission reference.

Dynamics user_impersonation permission

4. Review the configured Dynamics permission. The connected user’s Dynamics security roles still control access to records.

Configured Dynamics delegated permission

Part 2: Connect Dynamics 365 in Composio

Step 1: Create a custom auth config

1. In Composio, open Auth Configs and click Create.

Auth Configs Create button

2. Search for and select Dynamics 365.

Dynamics 365 toolkit selection

3. Enter a config name and click Next.

Dynamics configuration name

Step 2: Enter credentials and the environment permission

1. Choose OAuth 2.0 and Your Own Credentials. Enter your app’s Client id and client-secret Value. Keep the original redirect URI.

Custom Dynamics credential fields

2. Choose scopes for your Dynamics operations. Environment-specific scope values use the full Dynamics environment URL; the scope picker supports Add scope.

3. Click Create Auth Config. This is the delegated Dynamics permission for this signed-in-user flow.

Environment-specific Dynamics scope

Step 3: Connect the Dynamics account

1. Open the auth config and click Connect Account. Enter the organization name and environment host from your Dynamics URL. For https://yourorg.crm8.dynamics.com, use yourorg and crm8.dynamics.com.

Dynamics environment connection fields

2. Sign in with a work or school account that has access to that environment.

Microsoft work or school account picker

3. Review the app and Access Common Data Service as you permission, then click Accept. Leave organization-wide consent unchecked unless your administrator intends tenant-wide approval.

Dynamics environment access consent

Step 4: Confirm the connection is Active

1. Return to the auth config’s Connected Accounts tab and check Active on the account row. Copy the Auth Config ID for your application.

Dynamics connected account showing Active

Share