ODBC Driver for Microsoft Dynamics 365

Build 24.0.9175

Linux DSN Configuration

This section describes how to set up ODBC connectivity and configure DSNs on several Linux distributions: Debian-based systems, like Ubuntu, and Red Hat Linux platforms, like Red Hat Enterprise Linux (RHEL) and Fedora.

Minimum Linux Versions

Here are the minimum supported versions for Red Hat-based and Debian-based systems:

OSMin. Version
Ubuntu18.04
Debian10
RHEL8
Fedora28
SUSE15

Installing the Driver Dependencies

Run the following commands as root or with sudo to install the necessary dependencies:

  • Debian/Ubuntu:
    apt-get install libc6 libstdc++6 zlib1g libgcc1
  • RHEL/Fedora:
    yum install glibc libstdc++ zlib libgcc

Installing the Driver

You can use standard package management systems to install the driver.

On Debian-based systems, like Ubuntu, run the following command with root or sudo:

dpkg -i /path/to/driver/setup/Dynamics365ODBCDriverforUnix.deb 

On systems that support the RPM package format, run the following command with root or sudo:

rpm -ivh /path/to/driver/Dynamics365ODBCDriverforUnix.rpm 

Licensing the Driver

Run the following commands to license the driver. To activate a trial, omit the <key> input.

cd /opt/cdata/cdata-odbc-driver-for-dynamics365/bin/
sudo ./install-license.sh <key>

Connecting through the Driver Manager

The driver manager loads the driver and passes function calls from the application to the driver. You need to register the driver with the driver manager and you define DSNs in the driver manager's configuration files.

The driver installation registers the driver with the unixODBC driver manager and creates a system DSN. The unixODBC driver manager can be used from Python and from many other applications. Your application may embed another driver manager.

Creating the DSN

See Using unixODBC to install unixODBC and configure DSNs. See Using the DataDirect Driver Manager to create a DSN to connect to OBIEE, Informatica, and SAS.

Connecting to Microsoft Dynamics 365

The Microsoft Dynamics 365 driver supports connecting to the following Microsoft Dynamics 365 editions:

  • CustomerService
  • FieldService
  • FinOpsOnline (Default)
  • FinOpsOnPremise
  • HumanResources
  • Marketing
  • ProjectOperations
  • Sales

Notes:

  • Supply Chain Management is the same as Finance and Operations. To connect to either of these, set Edition to either FinOpsOnline or FinOpsOnPremise.
  • For Microsoft Dynamics 365 Business Central, use the separate Microsoft Dynamics 365 Business Central driver.

To connect, set these parameters:

Authenticating to Microsoft Dynamics 365

Microsoft Dynamics 365 supports authentication via Azure AD, Azure Service Principal, or Azure Managed Service Identity (MSI). All of these are based on the OAuth standard.

Azure AD

Authenticating via Azure AD requires you to create a custom AzureAD application, as described in Creating an Azure AD Application. You can authenticate with either a client secret or a JWT certificate.

To connect, set these properties:

Admin Consent

Admin consent refers to permissions granted by an Azure AD Tenant's admin to a custom application, as required for the use case. (Since the embedded application within the CData ODBC Driver for Microsoft Dynamics 365 contains no permissions that require Admin consent, admin consent only applies to custom applications.)

If your organization requires admin consent for authorizing any new OAuth application for your Azure Tenant, it means that the first time someone in your organization installs and uses an OAuth application, an administrator for the organization must explicitly grant that application access.

(Your organization can choose to disable this requirement.)

Granting Admin Consent

When creating a new OAuth application in the Azure Portal (see Creating an Azure AD Application), you must specify which permissions the application requires. If you know that your organization requires admin consent for new custom applications, you can start by specifying permissions that are already labeled Admin Consent Required. (For example, all Groups permissions require admin consent.)

There are two ways to grant admin consent:

  • The easiest way to grant admin consent is to just have an admin log into portal.azure.com and navigate to the application you have created in App Registrations. Under API Permissions, click Grant Consent. This grants your application the necessary permissions on the tenant on which it was created.
  • If your organization has multiple tenants or the application needs to be granted permissions for other tenants outside your organization, you can use the GetAdminConsentURL to generate the Admin Authorization URL. Unlike the GetOAuthAuthorizationUrl, there is no important information returned from this endpoint. If the tenant grants access, it returns a Boolean confirming that permissions were granted.

After an admin grants consent, authentication is performed as usual.

Client Credentials Auth Flow

Client credentials refers to a flow in OAuth where there is no direct user authentication taking place. Instead, credentials are created for just the application itself. All tasks taken by the application are done without a default user context. This makes the authentication flow a bit different from standard.

All permissions related to the client OAuth flow require admin consent. This means the application embedded with the CData ODBC Driver for Microsoft Dynamics 365 cannot be used in the client OAuth flow. You must create your own OAuth application to use client credentials, as described in Creating an Azure AD Application.

To do this:

  1. Login to portal.azure.com.
  2. Navigate to App Registration > API Permissions.
  3. Select the Microsoft Graph permissions. There are two distinct sets of permissions: Delegated Permissions and Application permissions. The permissions used during client credential authentication are under Application Permissions. Select the applicable permissions you require for your integration.

To connect, set these properties:

Azure Service Principal

Actions in Azure AD can be run by either user accounts or service principals. A service principal is a non-interactive account with elevated permissions, that performs tasks based on the roles and permissions assigned. Authentication as an Azure Service Principal is handled via the OAuth Client Credentials flow, without user involvementy Authentication as an Azure Service Principal requires you to create a custom AzureAD Service Principal application, as described in Creating a Custom AzureAD Service Principal App.

When you are ready to connect, set these properties:

Managed Service Identity (MSI)

If you are running Microsoft Dynamics 365 on an Azure VM and want to automatically obtain Managed Service Identity (MSI) credentials to connect, set AuthScheme to AzureMSI.

User-Managed Identities

To obtain a token for a managed identity, use the OAuthClientId property to specify the managed identity's client_id.

If your VM has multiple user-assigned managed identities, you must also specify OAuthClientId.

Refreshing OAuth Values

The driver can refresh the temporary OAuth access tokens obtained during the browser-based OAuth authentication exchange. By default, the driver saves the encrypted tokens in the odbc.ini file corresponding to the DSN. Access to this odbc.ini file can be restricted in the case of System DSNs.

To enable the automatic token exchange, you can give the driver write access to the system odbc.ini. Or, you can set the OAuthSettingsLocation connection property to an alternate file path, to which the driver would have read and write access.

    OAuthSettingsLocation=/tmp/oauthsettings.txt
    

Installing Dependencies for OAuth Authentication

The OAuth authentication standard requires the authenticating user to interact with Microsoft Dynamics 365, using a web-browser. If the first OAuth interaction is to be done on the same machine the driver is installed on, for example, a desktop application, the driver needs access to the xdg-open program, which opens the default browser.

To satisfy this dependency, install the corresponding package with your package manager:

Debian/Ubuntu PackageRHEL/Fedora PackageFile
xdg-utilsxdg-utilsxdg-open

Set the Driver Encoding

The ODBC drivers need to specify which encoding to use with the ODBC Driver Manager. By default, the CData ODBC Drivers for Unix are configured to use UTF-16 which is compatible with unixODBC, but other Driver Managers may require alternative encoding.

Alternatively, if you are using the ODBC driver from an application that uses the ANSI ODBC API it may be necessary to set the ANSI code page. For example, to import Japanese characters in an ANSI application, you can specify the code page in the config file '/opt/cdata/cdata-odbc-driver-for-dynamics365/lib/cdata.odbc.dynamics365.ini':

[Driver]
AnsiCodePage = 932

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 24.0.9175