Add Microsoft Dataverse (commondataservice) trigger + action sample#8
Open
manvkaur wants to merge 4 commits into
Open
Add Microsoft Dataverse (commondataservice) trigger + action sample#8manvkaur wants to merge 4 commits into
manvkaur wants to merge 4 commits into
Conversation
New self-contained dataverseApp/ sample: OnDataverseRowChanged trigger (GetOnNewItems_V2) plus ListDataverseRows HTTP action calling the connector's List rows operation. Auth uses system-assigned MI in Azure (ManagedIdentityCredential, no client id) and az login identity locally (AzureCliCredential), selected via IDENTITY_ENDPOINT. Includes azd/Bicep infra with Connector Namespace, connection, and access policies, post-deploy consent + trigger-config scripts, and README documenting the connector choice, known SubscribeWebhookTrigger 500, and identity guidance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 87bf03da-21a5-421b-b57a-fe347876f141
manvkaur
marked this pull request as ready for review
July 16, 2026 04:27
…es in README Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 87bf03da-21a5-421b-b57a-fe347876f141
| ) | ||
|
|
||
| # Table and row count are overridable per request; fall back to app settings. | ||
| table = req.params.get("table") or os.environ.get( |
Contributor
There was a problem hiding this comment.
Same nit here for runtime_url, dataset, and table - any constants can be moved to global variables.
hallvictoria
previously approved these changes
Jul 16, 2026
Replace the hand-crafted urllib call to the GetItems_V2 dataset path with the typed CommondataserviceClient.list_records_async from azure-connectors 0.3.0b2. The action is now async and passes explicit per-environment async credentials (ManagedIdentityCredential in Azure, AzureCliCredential locally) via AzureIdentityTokenProvider, so no DefaultAzureCredential or client id is used. The connection runtime URL identifies the environment, so the action no longer needs the org URL/dataset. Updates requirements.txt and README accordingly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 87bf03da-21a5-421b-b57a-fe347876f141
- Hoist startup constants (environment, table, runtime URL, IN_AZURE) to module globals; keep per-request table/top overrides on the action. - README: Python 3.13+, drop azure-functions beta pin (stable ships the connector decorator), condense the action/IDENTITY_ENDPOINT and top notes, and correct the portal-visibility caveat (runs are viewable once created via ARM/CLI; create/update still CLI-only). - Simplify inline comments and wrap all lines to satisfy flake8 (E501). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 87bf03da-21a5-421b-b57a-fe347876f141
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new self-contained
dataverseApp/sample demonstrating the Microsoft Dataverse (commondataservice) connector on Azure Functions (Flex Consumption, Python 3.13) via azd + Bicep + Connector Namespace.OnDataverseRowChangedGetOnNewItems_V2— fires when a new row is addedListDataverseRowsGetItems_V2— List rows, called on demandHighlights
azd env set— no code edits.DefaultAzureCredential, no client id): system-assigned managed identity in Azure (ManagedIdentityCredential),az loginuser identity locally (AzureCliCredential), selected viaIDENTITY_ENDPOINT. README documents whyIDENTITY_ENDPOINT(with the Microsoft Learn reference), its host-scope caveat, and production guidance to use a single credential.functionAccessPolicy.bicepmodule (applied after the app) to break the connection↔app dependency cycle..ps1+.sh): interactive OAuth consent, trigger-config creation against the function's connector webhook, resolve the org URL via Global Discovery and persist it asDATAVERSE_ENVIRONMENT_URL, and read the app's realdefaultHostName(no hardcoded.azurewebsites.net, so custom domains / sovereign clouds work).README.mdupdated to list the new sample (count Seven → Eight).Documented notes
commondataservice; its successorcommondataserviceforappsis Power Automate–only and not yet available for Logic Apps / Connector Namespaces.SubscribeWebhookTrigger("When a row is added, modified or deleted") returns HTTP 500 (Regex.Matchnull-ref) via Connector Namespace; the connector namespace team is working on support. This sample uses theGetOnNewItems_V2new-row trigger meanwhile.Verification
Provisioned to a live test subscription;
ListDataverseRowsreturned HTTP 200 with account rows via the function's MSI +functionapp-msiaccess policy.Notes for reviewers
local.settings.jsonis committed with placeholder values only (no secrets), matching the ask to include it..func/config.jsonfor Functions CLI v5.Marked as draft pending review.