omadiaomadia.ai
registry
integrationdynamics

Microsoft Dynamics 365 (CRM)

@omadia/integration-dynamics-crm

Microsoft Dynamics 365 / Dataverse connector for omadia. OAuth2 client-credentials Web API client (read-mostly). Publishes the 'dynamics.client' + 'dynamics.cache' services and contributes the read-only `dynamics_query` tool — accounts, contacts, leads, opportunities and any custom table. Writes (`dynamics_write`) are opt-in.

latest
v0.2.1
license
MIT
versions
1
author
byte5 GmbH

install

In your omadia instance, open Admin → Registries and add this registry, then install Microsoft Dynamics 365 (CRM) from Admin → Plugins → Store.

registryhttps://hub.omadia.ai

setup guide

Connect Microsoft Dynamics 365 (Dataverse)

This integration talks to the Dataverse Web API using an Azure AD app registration (server-to-server, OAuth2 client-credentials). About 10 minutes in the Azure + Power Platform admin portals. You collect four values — Tenant ID, Client ID, Client Secret, Environment URL — and paste them into the fields below.

1. Register an Azure AD application

  1. Azure PortalMicrosoft Entra IDApp registrationsNew registration. Name it (e.g. "omadia Dynamics") → Register.
  2. On the Overview page copy the Application (client) ID, then click Endpoints and copy the OAuth 2.0 token endpoint (v2) — that is your Token URL (it embeds the tenant).
  3. Certificates & secretsNew client secret → set a long expiry (e.g. 24 months) → Add → copy the secret Value immediately (NOT the Secret ID — the value is shown only once).

You do not need to add any API permissions in Azure AD for this. Server-to-server access to Dataverse is granted by the application user + security role in step 2 below, not by Azure AD API permissions.

2. Create the application user in Dynamics

  1. Power Platform Admin Center → your environment → Settings → Users + permissions → Application users+ New app user.
  2. + Add an app → pick the app you registered (search by name / client ID) → choose a Business unit.
  3. Assign a security role with read access (and write, only if you plan to enable writes) on the tables you need. A least-privilege custom role is recommended over a broad built-in role.

3. Find your Environment URL

Power Platform Admin CenterEnvironments → your environment → the Environment URL on the detail page, e.g. https://contoso.crm4.dynamics.com. The crmN segment encodes your region (e.g. crm4 = Europe, crm = North America).

4. Fill in the fields below

FieldValue
Token URLOAuth 2.0 token endpoint (v2) — step 1.2
Base URLEnvironment URL — step 3 (…/api/data/v9.2 optional)
Client IDApplication (client) ID — step 1.2
Client SecretThe secret Value — step 1.3
ScopeEnvironment URL + /.default
Grant typeclient_credentials (default)

Install — the connection is verified in the background with a WhoAmI call (watch the plugin logs for connected or a WhoAmI failed warning).

Troubleshooting

  • 401 / authentication failed — wrong Client Secret (you copied the Secret ID, not the Value), expired secret, or wrong Token URL / Scope.
  • 403 / forbidden — the application user has no security role, or the role lacks privilege on that table. Revisit step 2.3.
  • Cannot reach the host — your region's crmN host may be missing from the network allow-list. Add it to permissions.network.outbound and rebuild.

Least privilege: scope the security role to exactly the tables and verbs you need. Leave Enable writes off unless the assistant should create/update records.

versions

v0.2.1
>=1.0 <2.024.2 KB2026-07-02
.zip3bcf42cb2e91

setup fields

Values the operator fills in at install-time.

dynamics_token_urlstring
Token URLFull OAuth2 token endpoint, e.g. https://login.microsoftonline.com/<tenant>/oauth2/v2.0/token. From Azure AD → App registration → Overview → Endpoints → 'OAuth 2.0 token endpoint (v2)'. Maps to DYNAMICS_TOKEN_URL.
required
dynamics_base_urlstring
Base URL (Web API)Dataverse Web API base — either the environment root (https://contoso.crm4.dynamics.com) or the full API base (.../api/data/v9.2). If /api/data/ is missing, /api/data/v9.2 is appended. Maps to DYNAMICS_BASE_URL.
required
dynamics_client_idstring
Client ID (Application ID)Application (client) ID of the Azure AD app registration. Maps to DYNAMICS_CLIENT_ID.
required
dynamics_client_secretsecret
Client SecretThe client secret VALUE (Certificates & secrets → New client secret). Stored encrypted in the vault and shown only once. Maps to DYNAMICS_CLIENT_SECRET.
required
dynamics_scopestring
ScopeOAuth2 scope — the environment URL plus /.default, e.g. https://contoso.crm4.dynamics.com/.default. Maps to DYNAMICS_SCOPE.
required
dynamics_grant_typestring
Grant typeOAuth2 grant type. Default client_credentials. Maps to DYNAMICS_GRANT_TYPE.
optional
dynamics_max_bytesstring
Max response size (bytes)Caps a single Dataverse response to prevent memory blow-ups on large reads. Default 1048576 (1 MiB).
optional
dynamics_cache_ttl_secondsstring
Read cache TTL (seconds)How long identical read queries are cached in-process. Writes always bypass + clear the cache. Default 60.
optional
enable_writesboolean
Enable writesWhen ON, also registers the `dynamics_write` tool so the assistant can create/update records (delete is never exposed). Requires the application user to have write permission. Default OFF (read-only).
optional

permissions

memory

reads: [0] · writes: [0]

graph

reads: [0] · writes: [0]

network

outbound: [21]

filesystem

scratch: false