Share via

How to Integrate My Application Referral Submissions with Microsoft Dynamics 365 (Dataverse) Sync?

Elango 20 Reputation points
2026-04-28T11:07:32.19+00:00

Hi everyone, I’m working on integrating my application with Microsoft Dynamics 365 and need guidance.

Requirement:

When a referral is submitted in my application, I want it to automatically sync/push into Microsoft Dynamics 365 (likely Dataverse / Dynamics entities such as Leads, Contacts, or a custom Referral entity).

Looking for advice on:

Best approach for integrating with Dynamics 365 (Dataverse Web API, Microsoft Graph, Power Automate, etc.)

Recommended authentication flow (OAuth, Azure App Registration, service principal setup)

Handling create/update sync for referral records

Managing mapping between my application referral fields and Dynamics entities

Webhooks vs polling vs event-driven sync approaches

Any common issues with Dataverse permissions/service principal setup (I recently hit AADSTS650052)

Has anyone implemented a similar referral sync with Dynamics 365? Any architecture suggestions, examples, or best practices would be appreciated.

Microsoft 365 and Office | Development | Microsoft 365 App Publishing
0 comments No comments

Answer accepted by question author

Gabriel-N 17,785 Reputation points Microsoft External Staff Moderator
2026-04-28T11:48:17.37+00:00

Dear Elango

Please note that Microsoft Dynamics 365 is not currently supported in the Q&A forum. If you'd like more accurate and in-depth guidance on Dynamics 365 scenarios, I encourage you to post a question to the official Microsoft Dynamics 365 community. In that community, subject matter experts and product experts can provide additional support.

With Dynamics 365 Communities, you can quickly find answers, participate in discussions, post questions, and connect with peers and product experts to resolve Dynamics-related issues.

Also, since your inquiry related to tenant specific, if you're power platform admin, I strongly recommend that you create a support ticket through the Power Platform admin center so that Microsoft support can support you.

Thank you for your understanding.


Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-04-28T11:07:53.1966667+00:00

    For integrating referral submissions into Dynamics 365 (Dataverse), use Dataverse as the primary integration surface and choose an integration pattern and platform based on how much code and control are required.

    1. Platform choice and integration approach
    • Dataverse and Power Platform are the preferred platform for integrating Dynamics 365 apps on Azure. Dataverse provides a modern REST-based API and works with many data sources through connectors and Power Automate.
    • Common integration options include:
      • Direct Dataverse Web API from a custom app (full-code, maximum control).
      • Power Automate flows using Dataverse connectors (low-code, good for typical create/update scenarios).
      • Azure services such as Azure Functions, Azure Logic Apps, and Azure Service Bus for more advanced or high-scale integrations.
    • For a typical referral sync from a custom application, a common pattern is:
      • Application → secure API endpoint (e.g., Azure Function or Logic App) → Dataverse (Leads/Contacts/custom Referral table) using Dataverse connector or Web API.
    1. Authentication and identity
    • Use Microsoft Entra ID (formerly Azure AD) for secure identity management and OAuth for authenticating API requests.
    • Recommended setup:
      • Register an application in Microsoft Entra ID (Azure App Registration).
      • Configure a service principal for server-to-server (daemon) access to Dataverse.
      • Grant appropriate API permissions to Dataverse and consent them in the tenant.
    • Ensure all communication uses HTTPS/TLS 1.2 for encryption in transit.
    1. Patterns for create/update sync
    • Decide on the integration pattern:
      • One-way sync: Application is the system of record; Dataverse receives referrals as Leads/Contacts/Referral records. This is simpler and fits most referral scenarios.
      • Bidirectional sync: Both systems can update referral data; requires conflict resolution and more complex logic.
    • For one-way sync:
      • On referral submission, send a create request to Dataverse (Lead/Contact/custom Referral table).
      • On subsequent changes in the application, send update requests keyed by a shared identifier (e.g., external ID stored in Dataverse).
    • Use Dataverse’s REST API or Dataverse connectors in Logic Apps/Power Automate to perform create/update operations.
    1. Field mapping and data model
    • Model referral data in Dataverse:
      • Use existing entities such as Lead or Contact when possible.
      • Create a custom Referral table if the domain model does not fit standard entities.
    • Maintain a clear mapping between application fields and Dataverse columns:
      • Store the application’s referral ID in a dedicated column in Dataverse to support idempotent updates and correlation.
      • Align data types and constraints (e.g., option sets vs. free text, lookup fields for related entities).
    1. Triggering the sync: webhooks vs polling vs events
    • Common patterns for integration include:
      • Pull: The receiving system (Dataverse-side integration) periodically calls the application to fetch new/changed referrals.
      • One-way sync: The application pushes data to Dataverse after events (such as referral submission) occur.
      • Bidirectional sync: Both sides send changes based on events.
    • For referral submissions, a one-way event-driven push from the application is usually preferred:
      • Application raises an event on referral submission.
      • A webhook or message is sent to an integration layer (e.g., Azure Function/Logic App) that writes to Dataverse.
    • Use pull only if the application cannot emit events or webhooks but exposes an API that Dataverse-side integration can poll.
    1. Using Azure services for reliability and scale
    • Azure Logic Apps: Automate workflows and integrate services using prebuilt connectors, including Dataverse.
    • Azure Functions: Implement custom logic that triggers on HTTP calls or messages and then calls Dataverse.
    • Azure Service Bus: Introduce asynchronous messaging between the application and Dataverse integration to decouple systems and improve reliability.
    • For high-scale or complex workflows, combine these services:
      • Application → Service Bus queue → Azure Function → Dataverse.
    1. Permissions, limits, and common issues
    • Dataverse enforces service protection limits and entitlement-based API limits:
      • Plan API consumption to avoid throttling and failed operations.
      • Distribute load across service principals instead of a single user.
      • Use batching where possible and implement retry with exponential backoff in custom code.
      • Consider Azure Durable Functions or Logic Apps with delay/retry policies for resilience.
    • Monitor API usage and set alerts in Power Platform Admin Center; align heavy workloads with appropriate licenses or capacity add-ons.
    1. Handling the AADSTS650052 and similar issues
    • AADSTS650052 typically indicates a consent or configuration issue with the app registration or service principal.
    • Validate that:
      • The app registration has the correct API permissions for Dataverse.
      • Admin consent has been granted where required.
      • The correct tenant and redirect URIs are used for OAuth flows.
    1. Overall architecture suggestion
    • Recommended architecture for referral sync:
      1. Application raises an event on referral submission.
      2. Event is sent to an integration endpoint (HTTP-triggered Azure Function or Logic App).
      3. Integration component maps referral fields to Dataverse entities (Lead/Contact/Referral) and calls Dataverse via connector or Web API using a service principal.
      4. Integration handles retries, logging, and error handling; optionally uses Service Bus for buffering and decoupling.
      5. Dataverse stores the referral with an external ID to support future updates.

    This approach uses Dataverse as the central integration platform, leverages Azure services for orchestration and reliability, and follows recommended patterns for security, monitoring, and API governance.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.