0
votes

Currently I work on the application for fetching and downloading data from Office 365 services for given organization. I use such public APIs as EWS, SharePoint and Microsoft Graph for getting access to data for given user in organization (like Outlook, Calendar, OneDrive), groups (Team Site content, Planner, Conversations) and SharePoint content. I need to execute a lot of requests at the same time but unfortunately I experience throttling during this. There are some info in the internet related to using service accounts in order to decrease throttling rate but it's not enough such info at the moment.

How can use service accounts to overcome throttling in Office 365?

2

2 Answers

0
votes

Are you already using a service account, or do you actually have the credentials for each user whose data you are retrieving? Typically the way to avoid throttling is to get a service account with Impersonation rights to the individual calendars, etc. When querying the mailbox or calendar the service account impersonates the actual user so the connection and communicate charges are counted against the user and not the service account. This way, e.g. a single service account can launch many parallel requests for multiple users without the charges being accumulated against the actual service account and causing throttling.

0
votes

I've spent an intense amount of time dealing with this problem. Here is what we did:

1) Moved our automated processing to off peak hours (e.g. 6pm - 6am) 2) All calls need to have retry ability. MS says to use the value in the retry-after header, but it always 2 minutes. I'll retry for 20 minutes. If it fails after that time period, I don't try again for another hour.

Using service accounts is absolutely a workaround, albeit a terrible one. At some point, MS will adjust the algorithms again and you will be just as screwed. The real answer is retrying over periods of time.