B2C user updating email with graph API returns "message": " Count of cacheOperations is over the limit"

Yang, George 21 Reputation points
2021-07-01T18:40:44.947+00:00

We are using graph API to update B2C user SigninEmail, some users are updated fine but some users failed with this message:
{ "message": " Count of cacheOperations is over the limit"}.

What does this message mean?
How do we resolve it?

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,775 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,506 Reputation points
    2021-07-02T07:56:08.07+00:00

    Hi @Yang, George · Thank you for reaching out.

    Could you please try updating your code with exponential backoff approach, upon receiving Count of cacheOperations is over the limit error,

    1. Wait 1 second, retry request
    2. If still throttled wait 2 seconds, retry request
    3. If still throttled wait 4 seconds, retry request
    4. If still throttled wait 8 seconds, retry request
    5. If still throttled wait 16 seconds, retry request

    At this point you should no longer get the error.

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


  2. Richard Green 1 Reputation point
    2021-08-19T07:02:32.59+00:00

    I encountered the same issue as this yesterday when trying to update a users details. I noticed in the call we were also trying to update the UPN as well as the other details..

    Once I removed the userPrincipalName from the update while keeping the other details in (mail, surname, identities etc) the update to the user started to work again.

    I hope this helps someone and appreciate that if updating the userPrincipalName as well as the other details is a requirement in your user update that this may not help you.

    0 comments No comments

  3. Mattias 1 Reputation point
    2021-10-21T07:27:57.577+00:00

    I just came across the same issue and figured out what the problem was. Each time the mail property is updated on a B2C user, the previous email address will be copied and stored in the ProxyAddresses list. For Azure B2C, ProxyAddresses list can only hold 10 items. This results in a Bad Request with message Count of cacheOperations is over the limit.

    Here is the documentation which highlights the 10 item limit (see both mail and proxyAddresses properties)

    Hope it helps!

    0 comments No comments