Best Way to Post Appointments from SQL database to Exchange Via EWS

Richard Greenspan 1 Reputation point
2022-03-01T21:27:54.543+00:00

We have a web-based calendaring app that creates large groups of appointments and all-day events, stored in an Azure SQL database, and then posts them to Office 365 Outlook primary and secondary calendars using EWS. Processing and posting the events to calendars is very slow and the app currently prevents Users from working in the app, until it is complete. We are looking for the best way to speed up postings and/or process the postings in the background, freeing up Users to use the app for creating, updating and deleting during postings, while making sure that events coming onto Outlook calendars cannot be updated by Users until the processing is completed. Any suggestions on the best approach to take to deal with this issue?

Azure SQL Database
Azure Queue Storage
Azure Queue Storage
An Azure service that provides messaging queues in the cloud.
98 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
516 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Glen Scales 4,431 Reputation points
    2022-03-01T22:56:39.23+00:00

    while making sure that events coming onto Outlook calendars cannot be updated by Users until the processing is completed

    You can't do this in Exchange the way permissions work and the fact that all clients have equal status there is no way of locking or restricting access to calendar appointments, the best you can do in a Shared calendar is just give reviewer access to the whole calendar.

    Processing and posting the events to calendars is very slow and the app currently prevents Users from working in the app

    Probably you want to look at using the client credentials flow https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow and then impersonate the users you want to create appointments for. You can speed up the creation using batching in EWS https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-process-email-messages-in-batches-by-using-ews-in-exchange done correctly you can get a reasonable throughput (eg nearly all migration apps use EWS)

    0 comments No comments