Set Up an HTTP Connection to Microsoft Dataverse

Use an HTTP Connection to authenticate to Microsoft Dataverse. This lets you use HTTP GET Data Sources and Webhooks to read and write data through the Dynamics Web API.

Contents

Available on the Advanced and Enterprise tiers:

Essentials
Advanced
Enterprise

What you need before you begin

Note:Dynamics 365 and Dataverse use OAuth 2.0 for authentication. For server-to-server integrations, use the OAuth client credentials flow with an app registration in Microsoft Entra ID.

High-level overview of the setup steps

Setting up the connection requires completing tasks in both Microsoft Entra ID and the web portal, in sequence.

System Action
Microsoft Entra Register TrueContext as an application. Create a client secret and grant API permissions.
TrueContext Create an HTTP Connection using the credentials generated in Microsoft Entra.

Create the app registration in Microsoft Entra ID

Register TrueContext as an application in Microsoft Entra ID to generate the client ID and secret required for the HTTP Connection.

  1. In Microsoft Entra ID, go to App registrations, then select New registration.
  2. Enter a name for the app registration (for example, TrueContext Dynamics Integration), then select Register.
  3. Record the following values:
    • Tenant ID (Directory ID)
    • Client ID (Application ID)
  4. Create a client secret and store it securely:
    • Go to Certificates & secrets > New client secret.
    • After you create the secret, copy the secret value.

    Note:If your organization requires an approval workflow for app registrations or API permissions, complete that process before you create the TrueContext connection.

  5. Assign API permissions required for Dataverse access. At a minimum, the app must be able to request a token for the Dynamics resource and call the Web API.

Result: The app registration is ready with the client ID, secret, and Dataverse API permissions required to create the HTTP Connection.

Create the HTTP Connection in the web portal

Use the credentials from your app registration to create an HTTP Connection in the web portal.

  1. In the web portal, go to Connections > Create Connection.
  2. Select HTTP.
  3. In Name, enter a descriptive name (for example, Dynamics 365 Dataverse).
  4. Configure OAuth client credentials using the following values:
    FieldConfiguration
    Base Connection URL

    https://<org>.crm.dynamics.com

    In your browser, open the Dynamics 365 or Dataverse environment you want to connect to. In the address bar, find the host name (for example, https://contoso.org.crm.dynamics.com). Use the part before .crm as your <org> value.

    Access token URLhttps://login.microsoftonline.com/<tenantId>/oauth2/v2.0/token
    Client IDUse the Application (client) ID from your app registration. This is different from the secret key.
    Client SecretUse the client secret value you generated in Microsoft Entra ID.
    Scopehttps://<org>.crm.dynamics.com/.default
    HTTP Connection configuration showing OAuth client credentials fields for Microsoft Dynamics Dataverse.
  5. Select Create.
  6. Select Connect to verify that the connection is established.

Result: The HTTP Connection can request an access token and call the Dynamics Web API.

Verify that the connection works

After you connect, test a simple GET request using an HTTP Data SourceClosed Data sources, also known as "Lookups", are external sources of data that you upload or connect to TrueContext. You can reference this data in a form to populate answers or answer options. Data sources save typing, reduce errors, and make it easy to provide mobile users with only the relevant, most current data. or REST client. Confirm that the base URL and authentication are correct. Remember to include at least one parameter.

Example:

GET https://<org>.crm.dynamics.com/api/data/v9.2/msdyn_workorders?$top=1

Info:Learn more about how to use this Connection: Set up a Webhook and Set Up On-Demand Data SourcesClosed Data sources, also known as "Lookups", are external sources of data that you upload or connect to TrueContext. You can reference this data in a form to populate answers or answer options. Data sources save typing, reduce errors, and make it easy to provide mobile users with only the relevant, most current data..

Diagnose and fix connection errors

If the connection fails, use the following steps to diagnose authentication and permission issues.

Test credentials with Postman or curl

If you experience issues connecting, use a REST client such as Postman or curl. Verify your Microsoft Entra credentials and token configuration outside of TrueContext. This helps confirm whether the issue originates in your app registration or the TrueContext connection setup.

Common authentication and permission errors

401 Unauthorized

  • Confirm the Scope matches the Dynamics environment host and ends with .default.
  • Confirm the access token URL uses the correct tenant ID.
  • Confirm the client secret is valid and has not expired.

403 Forbidden

  • Confirm the app registration has appropriate Dataverse permissions for the target environment.
  • Confirm the integration account has permission to access the table you are querying or writing.