> For the complete documentation index, see [llms.txt](https://docs.appstrategy.com/apprules-r-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appstrategy.com/apprules-r-documentation/platform/platform-features/system-settings/data-sources/connection-settings/crm/dynamics365.md).

# Microsoft Dynamics 365

Microsoft Dynamics 365 uses [oAuth Authentication](/apprules-r-documentation/appendix/miscellaneous/oauth-authentication-azure-definition.md)

### Connection Properties

<table><thead><tr><th>Property</th><th width="130">Default</th><th>Notes</th></tr></thead><tbody><tr><td>Organization Url</td><td>—</td><td>Required. e.g. <code>https://yourorg.crm.dynamics.com</code></td></tr><tr><td>API Version</td><td><code>9.2</code></td><td>Known values: 9.2, 9.1, 9.0, 8.2, 8.1, 8.0. Leave blank to auto-negotiate the highest the server supports.</td></tr><tr><td>API Version Negotiation</td><td><code>Fixed</code></td><td>How the API version is settled at connect time.</td></tr><tr><td>Timeout</td><td><code>60</code></td><td>Connection timeout, seconds.</td></tr></tbody></table>

#### Authentication

**Auth Scheme** selects the mechanism: `AzureAD` (default), `AzureServicePrincipal`, `AzureServicePrincipalCert`, `AzureMSI`, `NTLM`, or `AccessToken`.

<table><thead><tr><th>Property</th><th>Used by</th><th width="295">Notes</th></tr></thead><tbody><tr><td>OAuth Client Id</td><td>AzureAD, service principal</td><td>Azure AD application (client) ID</td></tr><tr><td>OAuth Client Secret</td><td>AzureServicePrincipal</td><td>Application client secret</td></tr><tr><td>Tenant Id</td><td>AzureAD, service principal</td><td>Azure AD tenant ID</td></tr><tr><td>OAuth Callback URL</td><td>AzureAD</td><td>Default <code>http://localhost:33333</code></td></tr><tr><td>OAuth Access Token</td><td>AccessToken</td><td>Pre-obtained token</td></tr><tr><td>OAuth Refresh Token</td><td>AzureAD</td><td>Used for token renewal</td></tr><tr><td>Certificate Thumbprint</td><td>AzureServicePrincipalCert</td><td>Certificate in the store</td></tr><tr><td>Certificate Path</td><td>AzureServicePrincipalCert</td><td>Path to a <code>.pfx</code></td></tr><tr><td>Certificate Password</td><td>AzureServicePrincipalCert</td><td>Password for the <code>.pfx</code></td></tr><tr><td>User / Password / Domain</td><td>NTLM</td><td>On-premises deployments</td></tr><tr><td>Azure Environment</td><td>—</td><td><code>AzureCloud</code> (default), <code>AzureUSGovernment</code>, <code>AzureChinaCloud</code></td></tr></tbody></table>

#### Network

Proxy: **Proxy Server**, **Proxy Port**, **Proxy User**, **Proxy Password**, **Proxy Exceptions** (semicolon-separated bypass list), **Proxy Auth Scheme** (`BASIC`, `DIGEST`, `NEGOTIATE`, `NTLM`).

Firewall: **Firewall Type** (`NONE`, `TUNNEL`, `SOCKS4`, `SOCKS5`, `HTTP`), **Firewall Server**, **Firewall Port**, **Firewall User**, **Firewall Password**.

**SSL Server Cert** — `*` to accept any certificate, or a specific thumbprint.

#### Logging

| Property  | Default                                                                          | Notes                         |
| --------- | -------------------------------------------------------------------------------- | ----------------------------- |
| Log Level | `0`                                                                              | `0` disabled, `1` log to file |
| Log File  | `%APPDATA%\appStrategy\PortalData\Default\Logs\Connectors\Dynamics365_Debug.log` |                               |

***

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Property</td><td valign="top">Key (conn string)</td><td valign="top">Required?</td><td valign="top">Description</td></tr><tr><td valign="top">CRM URL</td><td valign="top">CrmUrl</td><td valign="top">Yes</td><td valign="top">Root URL of the Dynamics/Power Platform environment, e.g. https://myorg.crm.dynamics.com</td></tr><tr><td valign="top">Tenant Id</td><td valign="top">TenantId</td><td valign="top">Yes</td><td valign="top">Azure AD Tenant ID (GUID). Found in Azure Portal → Azure Active Directory → Overview.</td></tr><tr><td valign="top">OAuth Client Id</td><td valign="top">OAuthClientId</td><td valign="top">Yes</td><td valign="top">App Registration Client ID (GUID).</td></tr><tr><td valign="top">OAuth Client Secret</td><td valign="top">OAuthClientSecret</td><td valign="top">Yes</td><td valign="top">App Registration Client Secret value.</td></tr><tr><td valign="top">Auth Scheme</td><td valign="top">AuthScheme</td><td valign="top">No</td><td valign="top">ServicePrincipal (default) or OAuthRefreshToken.</td></tr><tr><td valign="top">API Version</td><td valign="top">ApiVersion</td><td valign="top">No</td><td valign="top">OData API version, e.g. 9.2 (default).</td></tr></tbody></table>

### Azure AD Setup

●        Register an App in Azure Portal → App Registrations.

●        Grant Dynamics 365 → user\_impersonation (Application permission) with admin consent.

●       Create an Application User tied to the App Registration and assign a security role.

### Minimum Connection String

CrmUrl=<https://myorg.crm.dynamics.com;TenantId=\\><GUID>;OAuthClientId=\<GUID>;OAuthClientSecret=\<secret>

<br>

&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.appstrategy.com/apprules-r-documentation/platform/platform-features/system-settings/data-sources/connection-settings/crm/dynamics365.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
