2025-08-05
Expose Dynamics 365 APIs with Power Platform Custom Connectors

Break the Wall: Power Automate × Dynamics 365 with Production-Grade Custom Connectors
Tagline
When the standard connector stops—your automation doesn’t have to.
What you’ll learn
-
How to identify missing capabilities in the standard Dynamics 365 connector
-
A practical workflow to discover the exact Dynamics/Dataverse Web API endpoints you need
-
Building a secure custom connector (OAuth2 via Azure AD, scopes, service principals)
-
Production patterns: filtering, pagination, throttling, retries, and schema evolution
-
Governance: DLP, RBAC, ownership, versioning, monitoring, and audit
The problem in one sentence
Standard connectors don’t always expose your custom tables, calculated fields, or flexible filters—custom connectors give you full API control with enterprise guardrails.
Reference blueprint (end-to-end)
1) Discover
-
Map missing needs (custom tables, columns, advanced filters, actions).
-
Use Dataverse Web API metadata, Solution Explorer, or API Inspector/Postman to confirm endpoints and logical names.
-
Validate OData $filter, $select, $expand queries with sample payloads.
2) Secure
-
Create Azure AD app registration (single-tenant, OAuth2).
-
Grant minimal Graph/Dataverse app roles; decide user-delegated vs service principal.
-
Configure redirect URL for custom connector; plan secret rotation.
3) Build
-
In Power Platform, create Custom Connector (OpenAPI or from scratch).
-
Define host, base path, auth, and actions (GET/POST/PATCH), including query/body schemas.
-
Add policies: retry with exponential back-off, pagination, set default headers, timeouts.
4) Govern
-
Assign owner, set environments (Dev/Test/Prod), and DLP policy classification.
-
Restrict usage via RBAC/security groups; document scopes and data domains.
-
Establish versioning (v1, v2…), change log, and deprecation timelines.
5) Operate
-
Monitor flow runs, connector telemetry; alert on 4xx/5xx spikes and long runtimes.
-
Add circuit-breakers, queued replays for 429 throttling; track consumption.
-
Quarterly review for permissions, secrets, and API changes.
API discovery quick guide
-
Find logical names: In your solution, check table/column logical names (e.g.,
new_pricetierlevelid). -
Test queries with Postman:
-
GET .../api/data/v9.2/new_warrantyclaims?$select=...&$filter=modifiedon ge {timestamp} -
Use
$expandfor lookups;$count+ pagination (@odata.nextLink).
-
-
Calculated/rollup fields: verify they’re materialized and filterable; otherwise compute server-side (FetchXML) or downstream.
-
Actions/Functions: call bound/unbound actions (e.g.,
CalculatePrice) when CRUD isn’t enough.
Security & privacy guardrails
-
OAuth2 (Azure AD), no API keys.
-
Least privilege: limit app roles to specific tables/operations; prefer service principals for background jobs.
-
User attribution: use delegated permissions when business needs a human audit trail.
-
DLP: classify connector as Business; block cross-boundary flows to personal services.
-
Data minimization:
$selectonly needed columns; mask PII downstream; apply environment RLS where relevant.
Production patterns (copy-paste worthy)
Exponential back-off for 429/5xx
-
Initial delay 2–5s; double up to cap (e.g., 60s); max retries 5–7; log correlation IDs.
Pagination
-
Honor
@odata.nextLink; aggregate pages server-side where possible; set page size (e.g.,$top=5000) within limits.
Delta loads
-
Filter by
modifiedon ge {lastRunUtc}; persist last successful watermark; handle clock skew.
-
Upserts (
PATCHwithIf-Match/alternate key) to avoid duplicates; store source IDs.
Schema evolution
-
Detect missing/extra fields; soft-fail unknowns; maintain v1/v2 connectors during migration.
Example use cases (and how the custom connector fixes them)
-
Custom table sync (WarrantyClaims)
-
Action:
GET /new_warrantyclaims?$select=claimid,status,amount&$filter=modifiedon ge {ts} -
Flow: Recurrence → Get claims → For Each → Upsert into Dataverse/ERP.
-
Advanced filter for “VIP Accounts”
-
Action:
GET /accounts?$filter=new_vipstatus eq true and statuscode eq 1 -
Flow: Trigger on schedule → Only act on VIP, active accounts → Notify CSMs.
-
Invoke server action (Recalculate)
-
Action:
POST /CalculateRevenue(unbound) with parameters (date range, segment). -
Flow: On demand/runbook → Call action → Store result in reporting table.
Monitoring & reliability
-
Dashboard: success rate, avg latency, retries, top error codes, throughput per action.
-
Alerts: sustained 429s, auth failures, >P95 latency, schema mismatches.
-
Logs: include request IDs, partition keys, and watermarks in telemetry for replay.
-
Resilience: queue overflow paths (e.g., Dataverse table/Azure Queue) on repeated failure.
Governance & lifecycle
-
Owner of record (app + connector), documented purpose, data domains, consumers.
-
Promotion workflow: PRD only from signed-off artifacts; env-specific secrets via connection references.
-
Review cadence: quarterly access review, secret rotation, API deprecation checks.
-
Decommissioning: mark as deprecated, block new connections, sunset after migration.
10-step fast start (week plan)
-
List gaps in the standard connector (tables/fields/filters/actions).
-
Confirm Web API endpoints & queries in Postman.
-
Register Azure AD app; decide delegated vs app-only.
-
Build custom connector (Dev); define actions & schemas.
-
Add policies: retries, pagination, headers, timeouts.
-
Create connection references per environment.
-
Ship a pilot flow; validate volume, filters, and idempotency.
-
Add monitoring + alerts; document runbooks.
-
Promote to Test/Prod; lock down via DLP/RBAC.
-
Publish v1 docs; plan v2 (known limits, roadmap).
Common pitfalls (and fixes)
-
429 throttling → implement back-off + batching; spread schedules.
-
Over-wide permissions → least-privilege app roles; split connectors by domain.
-
Hardcoded secrets → use service principals + managed secrets; rotate quarterly.
-
Connector sprawl → central catalog, owners, versioning policy.
-
Schema breaks → contract tests in Dev; dual-run v1/v2 during API changes.
FAQs
Q: Can I reach custom/ISV tables?
A: Yes—use their logical names via the Web API; add actions in the connector with proper schemas.
Q: Delegated or app-only?
A: App-only for backend/scheduled jobs; delegated when you need user-level audit/control.
Q: How do I stay compliant with DLP?
A: Classify as Business, block cross-boundary connectors, restrict usage by security group, and log exports.
Q: What about performance at scale?
A: Batch reads, delta queries, back-off on 429s, parallelism with care; monitor and tune $top/filters.
FAQ
When do you need a custom connector for Dynamics 365?
When the standard connector does not expose your custom tables, calculated fields or flexible filters. A custom connector gives full API control, with enterprise guardrails around security and governance.
How do you find the right Dynamics 365 API endpoints?
Use Dataverse Web API metadata, Solution Explorer or tools like API Inspector or Postman to confirm endpoints and logical names, then validate OData filter, select and expand queries with sample payloads.
How do you secure a custom connector?
Create a single-tenant Azure AD app registration with OAuth2, grant minimal Graph or Dataverse app roles, choose delegated or service principal access, configure the redirect URL and plan secret rotation.
What production patterns matter for custom connectors?
Filtering, pagination, throttling, retries and schema evolution. Policies such as retry should be built in so flows keep working when APIs are rate limited or their schemas change.
How should custom connectors be governed?
Apply DLP, role-based access control, clear ownership, versioning, monitoring and audit. These controls keep custom connectors from becoming a governance gap or a security risk in enterprise environments.
Apple Podcasts · Spotify · YouTube
Host: Mirko Peters
Related articles
Articles on the topics of this episode:
- Unlocking Advanced Dynamics 365 Data with Production Custom Connectors
- Microsoft Graph HTTP Status Codes: A Troubleshooting Guide for Power Automate
- Microsoft Entra Agent ID vs Service Principals: Which Should Your AI Agents Use?
- Building Secure Email Solutions: Sending Mail via Microsoft Graph for Developers
- Say Goodbye to Legacy RPA: How Copilot Studio Computer Use Changes Everything
- Service Accounts vs App Registrations: Which Should You Use for Power Automate?
- How Managed Identities Eliminate Hardcoded Passwords in Azure
- Authentication Best Practices: Avoiding 401 and 403 Errors in Dynamics 365