Skip to content

feat: add Microsoft Dataverse (commondataservice) connector client#192

Open
daviburg wants to merge 7 commits into
mainfrom
feature/dataverse-connector
Open

feat: add Microsoft Dataverse (commondataservice) connector client#192
daviburg wants to merge 7 commits into
mainfrom
feature/dataverse-connector

Conversation

@daviburg

@daviburg daviburg commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

Adds the Microsoft Dataverse connector client (commondataservice) to the SDK — the current-environment Microsoft Dataverse connector available in Logic Apps.

Note on naming: The public connector reference documents the current connector as commondataserviceforapps ("Microsoft Dataverse"). However, that connector ID is not exposed in the Logic Apps managed-APIs ARM surface (verified 404 across westus/eastus/westus2/centralus/westeurope/northeurope/eastus2) — per Microsoft docs it does not yet support Logic Apps. The Logic Apps commondataservice connector (title "Microsoft Dataverse") already carries the modern current-environment operations, so it is the de-facto current Dataverse client for Logic Apps. The deprecated legacy commondataservice operations are excluded by the generator's existing deprecation filter.

Generated operations (29 methods)

  • Row operations: ListRecordsAsync (AsyncPageable), CreateRecordAsync, GetItemCodelessAsync, UpdateRecordAsync, DeleteRecordAsync
  • Actions: PerformBoundActionAsync, PerformUnboundActionAsync (+ bound/unbound discovery & metadata)
  • Relationships: AssociateEntitiesAsync, DisassociateEntitiesAsync
  • Search & files: GetRelevantRowsAsync, UpdateEntityFileImageFieldContentAsync, GetEntityFileImageFieldContentAsync
  • Transactions: ExecuteChangesetAsync

Deprecated legacy operations (PostItem/GetItems/PatchItem/DeleteItem) are excluded by the generator's deprecation filter — no generator change was required.

Changes

  • src/Azure.Connectors.Sdk/Generated/CommondataserviceExtensions.cs — generated client (do not hand-edit; regenerate via the BPM CodefulSdkGenerator).
  • tests/Azure.Connectors.Sdk.Tests/CommondataserviceClientTests.cs — constructors, dispose, mocked API call, error handling, serialization round-trips.
  • ROADMAP.md (2.1 Dataverse → Complete), CHANGELOG.md ([Unreleased] → Added), connection-setup skill connector list.
  • Registry files (ConnectorNames.cs / ManagedConnectors.cs) already contained commondataservice — no edits.

Validation

  • dotnet build: 0 warnings, 0 errors.
  • dotnet test: 861 passed, 0 failed (incl. ConnectorConstants registry tests).

E2E validation (sample app, AI Gateway connection, OAuth consent) is not included in this PR.

Generate the current-environment Microsoft Dataverse connector client via the BPM CodefulSdkGenerator (--directClient --connectors=commondataservice).

The generated CommondataserviceClient covers modern row operations (ListRecords, CreateRecord, GetItemCodeless, UpdateRecord, DeleteRecord), bound/unbound actions, relate/unrelate, relevance search, file/image column upload/download, and changeset transactions. Deprecated legacy dataset/table operations are excluded by the generator's existing deprecation filter.

Adds CommondataserviceClientTests.cs (constructors, dispose, mocked API call, error handling, serialization round-trips). Updates ROADMAP (2.1 Dataverse -> Complete), CHANGELOG [Unreleased], and the connection-setup skill connector list. Registry files (ConnectorNames/ManagedConnectors) already contained commondataservice.
Copilot AI review requested due to automatic review settings June 11, 2026 19:08
@daviburg daviburg requested a review from a team as a code owner June 11, 2026 19:08
@daviburg daviburg requested a review from eprofeta June 11, 2026 19:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new generated typed client for the Logic Apps Microsoft Dataverse connector (commondataservice) to the SDK, along with initial unit tests and documentation/roadmap updates.

Changes:

  • Added generated CommondataserviceClient (plus models, trigger constants/parameters, and model factory) for commondataservice.
  • Added unit tests covering construction/disposal, a mocked API call, error handling, and basic model JSON round-trips.
  • Updated docs/metadata (ROADMAP, CHANGELOG, and connection-setup skill connector list) to reflect the new connector client.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Azure.Connectors.Sdk/Generated/CommondataserviceExtensions.cs New generated Dataverse connector client, models, trigger constants/metadata, and model factory.
tests/Azure.Connectors.Sdk.Tests/CommondataserviceClientTests.cs New tests for client construction/disposal, mocked responses, error handling, and serialization round-trips.
ROADMAP.md Marks Dataverse (commondataservice) as complete in Phase 2.
CHANGELOG.md Adds an Unreleased entry documenting the new Dataverse client.
.github/skills/connection-setup/SKILL.md Adds commondataservice to the supported connector name list.

Comment thread src/Azure.Connectors.Sdk/Generated/CommondataserviceExtensions.cs Outdated
Comment thread src/Azure.Connectors.Sdk/Generated/CommondataserviceExtensions.cs Outdated
Comment thread src/Azure.Connectors.Sdk/Generated/CommondataserviceExtensions.cs Outdated
…+FFFD sanitization fix

Regenerated CommondataserviceExtensions.cs with the BPM CodefulSdkGenerator fix that normalizes the Unicode replacement character (U+FFFD) in swagger text to an apostrophe. The 'Upsert a row' XML doc remark now reads 'doesn't exist' instead of containing a corrupted replacement character.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Comment thread src/Azure.Connectors.Sdk/Generated/CommondataserviceExtensions.cs Outdated
Comment thread src/Azure.Connectors.Sdk/Generated/CommondataserviceExtensions.cs Outdated
Comment thread src/Azure.Connectors.Sdk/Generated/CommondataserviceExtensions.cs Outdated
…ext fixes

Regenerated CommondataserviceExtensions.cs after adding 'by pass'->'bypass' and 'Odata'->'OData' corrections to the generator's SwaggerTextCorrections (BPM PR 16059042).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Comment thread tests/Azure.Connectors.Sdk.Tests/CommondataserviceClientTests.cs Outdated
ConnectorClientBase.Dispose only sets a disposed flag (no internal HttpClient field or post-dispose guard), so Dispose_WithInternallyCreatedHttpClient_ShouldDisposeIt did not verify disposal and duplicated Dispose_CalledTwice_ShouldNotThrow. Removed it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Comment thread src/Azure.Connectors.Sdk/Generated/CommondataserviceExtensions.cs Outdated
…angeset op

ExecuteChangeset consumes multipart/mixed and the swagger models no request body; ConnectorClientBase cannot compose multipart payloads, so the generated ExecuteChangesetAsync was unusable. Added a generator skip for multipart-consuming operations (BPM PR 16059042) and regenerated; ExecuteChangesetAsync is no longer emitted.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Comment thread CHANGELOG.md Outdated
Comment thread ROADMAP.md Outdated
ExecuteChangesetAsync is no longer generated (multipart op skipped), so remove the now-inaccurate changeset mentions from the Unreleased changelog entry and the ROADMAP Dataverse row.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

Regenerated the Dataverse client using only the legacy CDM v2 API paths
(e.g., /v2/datasets/{dataset}/tables/{table}/items) that are supported
through the Connector Namespace routing layer.

Key changes:
- Replaced modern Dataverse Web API paths (which return 404 via
  Connector Namespace) with working legacy v2/CDM paths
- Added DoubleEscape helper for x-ms-url-encoding: double support
  (dataset URLs contain slashes/colons that need double encoding)
- Client now exposes 22 operations: CRUD, metadata, attachments,
  relationships, triggers, and pagination
- Updated tests to match new API surface (DataSet/DataSetsList
  instead of OrganizationsDynamicValuesList)

E2E validated against devrelprod.crm.dynamics.com:
- GetDataSetsAsync: 1330 environments returned
- GetTablesAsync: 884 tables listed
- GetItemsAsync: account records successfully read
@daviburg

Copy link
Copy Markdown
Member Author

E2E Validation — Legacy CDM v2 Paths ✅

Regenerated the Dataverse client with legacy CDM v2 API paths (the only paths supported through Connector Namespace routing). All three validation functions tested successfully against \devrelprod.crm.dynamics.com:

Operation Result Details
GetEnvironments (/v2/datasets) ✅ 200 1330 environments returned (601ms)
GetTables (/v2/datasets/{env}/tables) ✅ 200 884 tables from devrelprod (8.2s)
GetItems (/v2/datasets/{env}/tables/{table}/items) ✅ 200 Account records with full data (4.3s)

Key Technical Details

  • 22 operations now exposed (CRUD, metadata, attachments, relationships, triggers, pagination)
  • Added \DoubleEscape\ helper for \x-ms-url-encoding: double\ support — dataset values are full URLs (e.g., \https://devrelprod.crm.dynamics.com\) that need double URL encoding to survive server-side path decoding
  • Modern Dataverse Web API paths (/api/data/v9.1/...) confirmed returning 404 through Connector Namespace — excluded from generated client
  • 860/860 unit tests passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants