web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Connect Dynamics 365 (on-premises v9.1) to Exchange Online security and permission

(4) ShareShare
ReportReport
Posted on by 12
Before we Connect Dynamics 365 (on-premises) to Exchange Online, we would like to get more information about what's actually setup when the next is executed:
ref: https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/admin/connect-dynamics-365-on-premises-exchange-online?view=op-9-1
 
In the documentation it is described that we need:
  • Run scripts as Global Admin
  • Create an "Enterprise Application" which must have, among other things, the following rights "Application.ReadWrite.All | Type: Application"
 These are very large permissions and the documentation is not clear about what is set up with this.
 
Questions:
  • How does access and authentication to user mailboxes and SharePoint pages take place when this is set up?
  • Is it done through an created "Enterprise Application" with Delegated Rights?
  • Can Dynamics On-Premise access any mailboxes and all SharePoint sites after this Deployment? But it will only crawl the ones configured but still has the permissions? "Dynamic 365 administrator can approve mailboxes"
  • Have we given the "Dynamic On-Premise" system any rights in Microsoft 365 it didn't have before?
      - What rights does this "Connector" have after setup?
      - Is an "Enterprise Application" used for accessing users mailboxes and SharePoint sites?
  • Have we given "Dynamic Admins" any additional rights they didn't had before?
       "Dynamic 365 administrator can approve mailboxes"
Important:
We need to understand in detail what it is we are creating with described admin roles, enterprise application rights and scripts in our tenant following the instructions in the MS White paper for the connector?
If it is not handled with an "Enterprise Application" with "Delegated" rights for EXO and SPO, we need explanation on how this "Connector" can read/send emails, update calendars and read/write in individual SPO sites.

 
 
Categories:
I have the same question (0)
  • JessonCoock Profile Picture
    26 on at

    The "Enterprise Application" uses Application.ReadWrite.All permissions to access resources like mailboxes and SharePoint. It grants Dynamics 365 On-Premises access to configured mailboxes and sites but won’t crawl unconfigured ones. Admins can approve mailboxes; no additional admin rights are granted.

  • AP-19041205-0 Profile Picture
    51 on at
    Do you found a solution to integrated Dynamics 365 on premise with exchange online.
    We have followed the procedure described by Microsoft. The requirement are verified, but the issue happen when
    we test the connectivity. The Certificate is accessed correctly for the signing and the bearer token is included in the request sent to EWS
    but EWS return 401 error bad token. The token generated used is a ACS token. But because ACS is not supported by entra for exchange the issue happen.
    I don't know if you found a solution for this issue or you have a specific config for exchange.
    For the moment I am completly blocked with this issue.
  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    7,835 Super User 2025 Season 2 on at
    Hello JV-17010938-0,
     

    You've raised very valid and important security concerns regarding the permissions required to connect Dynamics 365 on-premises to Exchange Online. The documentation's requirement for broad tenant-wide permissions for the Enterprise Application can indeed seem excessive without a clear understanding of its scope and usage.

    Let's break down your questions and clarify what happens during this setup:

    Understanding the Setup and Permissions:

    When you follow the steps to connect Dynamics 365 on-premises to Exchange Online using Server-Side Synchronization, you are essentially establishing a trusted communication channel between your on-premises Dynamics 365 environment and your Microsoft 365 tenant. This involves the creation and configuration of an Azure Active Directory (Azure AD) Enterprise Application.

    Answers to Your Questions:

    • How does access and authentication to user mailboxes and SharePoint pages take place when this is set up?

      Access and authentication primarily take place through the Enterprise Application you create in Azure AD. This application acts as a service principal, representing your Dynamics 365 on-premises instance in your Microsoft 365 tenant.

      • Exchange Online: The Enterprise Application is granted permissions to interact with Exchange Online via the Microsoft Graph API. The Application.ReadWrite.All permission allows the application to read, update, and delete all mailboxes in the organization. However, Dynamics 365 on-premises will only interact with mailboxes that have been explicitly configured and approved within Dynamics 365 for Server-Side Synchronization. The broad permission is a requirement for the connector to function across different mailboxes as configured by Dynamics 365 administrators.

      • SharePoint Online: Similarly, for integrating with SharePoint (e.g., for document management), the Enterprise Application is granted permissions to interact with SharePoint Online, often requiring Sites.ReadWrite.All. Again, Dynamics 365 on-premises will only access and manage document libraries on SharePoint sites that have been explicitly configured within Dynamics 365 for record-level integration

          


    • Is it done through an created "Enterprise Application" with Delegated Rights?

       

      No, the Enterprise Application used for Server-Side Synchronization typically uses Application Permissions, not Delegated Permissions.

      • Application Permissions are granted directly to the application itself. The application runs with its own identity and doesn't require a signed-in user to operate. This is necessary for server-to-server communication where a specific user might not always be present.

      • Delegated Permissions grant the application permissions to act on behalf of a signed-in user.

      The documentation explicitly mentions "Application.ReadWrite.All | Type: Application," confirming the use of Application Permissions.


    • Can Dynamics On-Premise access any mailboxes and all SharePoint sites after this Deployment? But it will only crawl the ones configured but still has the permissions? "Dynamic 365 administrator can approve mailboxes"

       

      Technically, yes, the Enterprise Application will possess the broad permissions granted. However, the crucial point is that Dynamics 365 on-premises will only actively access and process data in the mailboxes and SharePoint sites that have been explicitly configured and approved within the Dynamics 365 administration interface for Server-Side Synchronization and SharePoint integration.

      • The "Dynamic 365 administrator can approve mailboxes" step is a critical control. Even though the Enterprise Application has the permission to access all mailboxes, it will only actually interact with those that a Dynamics 365 administrator has explicitly approved for synchronization. This approval process acts as a scope control within Dynamics 365.

      • Similarly, for SharePoint integration, you need to specifically configure which SharePoint sites or document libraries are linked to Dynamics 365 records. The broad Sites.ReadWrite.All permission allows the connector to work with any configured site, but it won't automatically access or "crawl" all SharePoint sites without explicit configuration within Dynamics 365.

         


    • Have we given the "Dynamic On-Premise" system any rights in Microsoft 365 it didn't have before?

      • What rights does this "Connector" have after setup? Yes, you are granting the Enterprise Application (representing your Dynamics 365 on-premises system) significant rights within your Microsoft 365 tenant, specifically the ability to read and write to all mailboxes (Application.ReadWrite.All) and potentially read and write to all SharePoint sites (Sites.ReadWrite.All).

      • Is an "Enterprise Application" used for accessing users mailboxes and SharePoint sites? Yes, the created Enterprise Application is the key identity and authorization mechanism for Dynamics 365 on-premises to access these Microsoft 365 services.

      •  

    • Have we given "Dynamic Admins" any additional rights they didn't have before? "Dynamic 365 administrator can approve mailboxes"

      The "Dynamic 365 administrator can approve mailboxes" right is a function within the Dynamics 365 on-premises application itself. It allows Dynamics 365 administrators to control which user mailboxes are enabled for Server-Side Synchronization using the established connection. This doesn't directly grant Dynamics 365 administrators new administrative rights within the Microsoft 365 tenant itself. Their control is limited to the configuration and approval processes within the Dynamics 365 application, which then leverages the permissions of the Enterprise Application.


    •  

    In Detail: What You Are Creating

    Following the instructions, you are essentially:

    1. Creating a Service Principal (Enterprise Application) in your Azure AD. This acts as the identity of your Dynamics 365 on-premises system in the cloud.

    2. Granting this Service Principal broad Application Permissions to Exchange Online (via Microsoft Graph) and SharePoint Online. These permissions allow the application to perform actions on all mailboxes and SharePoint sites without requiring a signed-in user context.

    3. Configuring Dynamics 365 on-premises with the Client ID and Secret of this Enterprise Application. This establishes the trust relationship and allows Dynamics 365 to authenticate with Azure AD using the application's identity.

    4. Within Dynamics 365, administrators then explicitly configure and approve specific user mailboxes for Server-Side Synchronization and specific SharePoint sites for integration. This acts as the scoping mechanism, determining which mailboxes and sites the Dynamics 365 system will actually interact with, despite the broad permissions granted to the Enterprise Application.

    5.  

    Why Application Permissions and Broad Scope?

    The requirement for broad Application Permissions stems from the need for the Dynamics 365 on-premises service to operate autonomously and access various user resources as configured by administrators within Dynamics 365. It needs the potential to interact with any mailbox or SharePoint site that an administrator might configure for integration.

     

    Mitigating Security Concerns:

    While the permissions are broad, the actual access is controlled within Dynamics 365 through the explicit configuration and approval processes. To mitigate security concerns:

    • Principle of Least Privilege (within Dynamics 365): Only configure and approve the specific mailboxes and SharePoint sites that are absolutely necessary for the integration.

    • Regular Auditing: Periodically review the configured Server-Side Synchronization mailboxes and SharePoint integrations within Dynamics 365.

    • Secure Storage of Credentials: Ensure the Client ID and Secret of the Enterprise Application are securely stored within your Dynamics 365 on-premises environment.

    • Monitor Azure AD Logs: Regularly monitor the sign-in logs and audit logs for the Enterprise Application in Azure AD for any unusual activity.


    •  

    If Not Delegated Rights, How Does It Work?

    Since Application Permissions are used, the Dynamics 365 on-premises system (acting as the Enterprise Application) authenticates directly with Azure AD using its Client ID and Secret. Once authenticated and authorized (due to the granted permissions), it can then access the Microsoft Graph API to interact with Exchange Online and SharePoint Online. The scope of this interaction is then limited by the explicit configurations made within the Dynamics 365 administration interface.

    In essence, you are granting the permission for broad access at the tenant level to enable the connector's functionality, but the actual access is scoped down within the Dynamics 365 application through configuration and approval processes.

    It is crucial to understand this distinction between the permissions granted to the Enterprise Application and the actual access exercised by the Dynamics 365 on-premises system based on its internal configuration. While the broad permissions might seem alarming, the internal controls within Dynamics 365 are what define the effective scope of the integration.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak
  • CU24040559-0 Profile Picture
    5 on at
     Thank Daivat Vartak, for your response.
    But Concretly, I understand an app on the tenant will represent Dynamics 365 on prem.
    But how Dynamics 365 V9.1 must be configured to use this application for the Authorization.
    By default the entities who are setup uses ACS.
    Except if the rollup update version V 9.1.17.29 we are using is not supporting the mechanism you describe?
    Or if with Powershell or database query we can activate it.
    What is missing here are the step to do on Dynamics 365 V9.1 to enable the flow you have describe in your response.
    Regards
    Angelo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 41 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 39

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans