0

I have an Active Directory sync app which is using for internal purpose and its saving the data to SQL table feeding from Azure AD via Graph API. Along with its basic functionality, we are updating custom user profile properties using CSOM. But most of the time after some request processing, we are getting Error 429, Too many requests.

Is there any option of bulk update to update a set of (say 500/1000 profile) custom user profile properties in a single request? Please help me on this. If there is any other option, please suggest.

Thanks in advance.

1 Answer 1

0

Cause:

When a user exceeds usage limits or request frequency limits, SharePoint Online throttles any further requests from that user account for a short period.For requests including CSOM or REST calls, SharePoint Online returns HTTP status code 429 ("Too many requests") or 503 ("Server Too Busy") and the requests will fail.

Possible work arounds:

  1. Please check if the response includes a Retry-After value .Please wait till that time and retry later . Making additional calls while receiving throttle before the reftry-after time period responses will extend the time it takes for your app to become unthrottled.

Note: Not all of the Microsoft Graph APIs provide a Retry-After header. In this case have an initial wait period and keep increasing it exponentially with each 429 response.

  1. Make sure your app in azure ad has Sites.FullControl.All and User.ReadWrite.All permission scopes and grant admin consent . Also check the same in xml for FullControl in app permissions.

  2. Try to select only those user profile properties that you need in the request and avoid which are not necessary.

  3. Use JSON batching to combine multiple requests into a single batch request.

  4. Try using ExecuteQueryAsync() instead of ExecuteQuery() or vice versa or ExecuteQueryWithIncrementalRetry . Optional: try to use ExecuteQuery calls with Start-Sleep -Milliseconds 1000 statements, especially if calling it in a loop.

Otherwise please try with these powershell module references:

  1. Bulk Update | so ref
  2. update User Profile

Other references:

  1. Azure AD Graph API-SO
  2. Microsoft Graph throttling guidance | Microsoft Docs
  3. 429 error-SO ref
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.