Share via

Azure ADB2C | Graph API

Abhay Chandramouli 1,061 Reputation points
2023-10-02T08:40:37.23+00:00

Hi

We are trying to update the user's password using MS Graph API / users

We are getting below error.

{

    "error": {

        "code": "Directory_ConcurrencyViolation",

        "message": "Error due to concurrent requests being made to the tenant. Please wait briefly and retry.",

        "innerError": {

            "date": "2023-09-29T11:09:56",

            "request-id": "5bd2f8085f2",

            "client-request-id": "5bd2fcd8085f2"

        }

    }

}
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 46,456 Reputation points
    2023-10-03T07:43:33.86+00:00

    Hi @Abhay Chandramouli

    This looks like a throttling error caused by too many requests to the Microsoft Graph API in a short period of time. Throttling is a mechanism that limits the number of concurrent calls to a service to prevent overuse of resources. Microsoft Graph has different throttling limits for different scenarios and services. For example, if you are performing a large volume of writes, the possibility for throttling is higher than if you are only performing reads.

    For handling throttling errors, refer to the following best practices:

    • Reduce the number of operations per request.
    • Reduce the frequency of calls.
    • Avoid immediate retries, because all requests accrue against your usage limits.

    When you implement error handling, use the HTTP error code 429 to detect throttling. The failed response includes the Retry-After response header. Backing off requests using the Retry-After delay is the fastest way to recover from throttling because Microsoft Graph continues to log resource usage while a client is being throttled.

    1. Wait the number of seconds specified in the Retry-After header.
    2. Retry the request.
    3. If the request fails again with a 429 error code, you are still being throttled. Continue to use the recommended Retry-After delay and retry the request until it succeeds.

    All the resources and APIs described in the Service-specific limits provide a Retry-After header except when noted.

    If no Retry-After header is provided by the response, we recommend implementing an exponential backoff retry policy.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    Was this answer helpful?


  2. JamesTran-MSFT 37,256 Reputation points Microsoft Employee Moderator
    2023-10-02T22:11:38.95+00:00

    @Abhay Chandramouli

    Thank you for your post!

    Error Message

    Directory_ConcurrencyViolation: Error due to concurrent requests being made to the tenant. Please wait briefly and retry.

    I understand that you're trying to update a user's password using the MS Graph API user resource type but are running into the above error message. To hopefully help point you in the right direction or resolve your issue, I'll share my findings below.


    Findings:

    Based off your error message, it looks like there were multiple requests being made to the tenant at the same time. To resolve this, you should be able to follow the suggestion within the error and wait a few minutes to retry the request.

    If you're making multiple requests and are continually running into this error, you can look into JSON Batching to group multiple requests into a single HTTP request, which will help reduce the number of requests made to the API.

    Additional Links:

    I hope this helps!

    If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.

    Was this answer helpful?

    0 comments No comments

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.