How to change default rest request timeout and retry

Matt 25 Reputation points
2025-05-01T19:45:34.2033333+00:00

I have a RESTful technical profile making an API call to an external service that takes between 7-15 seconds to return a response and I'm getting ResponseCode 0 with the error message "Client connection was unexpectedly closed." for requests that take longer than 10 seconds and then a retry is triggered.

I found this in the Azure documentation:

"HTTP requests may be cancelled if there is a slow or no response from the RESTful service to Azure AD B2C. The default timeout is 10 seconds and the default retry count is one (meaning there are 2 tries in total)."

https://learn.microsoft.com/en-us/azure/active-directory-b2c/api-connectors-overview?pivots=b2c-custom-policy

It mentions a default timeout of 10 seconds and default retry count of one but I can't find how to change the defaults. Is this possible?

Microsoft Security | Microsoft Entra | Other
{count} vote

Accepted answer
  1. Kancharla Saiteja 6,065 Reputation points Microsoft External Staff Moderator
    2025-05-05T12:23:20.4033333+00:00

    Hi @Matt,

    Based on your query, here is my understanding: you would like to know if there is any change possible for default time out of REST API requests.

    This is the latest update available regarding REST API. Previously we used to have a time out frame of 30 seconds which has been changed to 10 seconds now. If you would like to go back to 30 seconds timeout frame, you can revert only for production environment only and this is not possible for non-production environment.

    Note: This extension is only until the end of this year i.e. 12/31/2025.

    In case if you would like to revert back to 30 seconds, please check the steps in the private message for further proceedings on the same.

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

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

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Gunther Lochstampfer 0 Reputation points
    2025-08-05T14:06:15.4266667+00:00

    After MS Production team increased timeout to 30s results were still strange:

    Expected behaviour:
    B2C Policy sends API REST call, timeout 30s, after that retry for one more call
    Reality:
    B2C Policy sends API REST call, still after 10s the concurrent retry call is sent and one of them is succussful or not

    Conclusio:
    MS has to implement correct retry and timeout behaviour or stop retry handling or give us a metadata switch in B2C REST endpoint.
    Customers also have to handle idempotent retry behaviour in their APIs called by B2C

    Increasing timeout to 30s is not a current valid option !


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.