App Server ARRAffinity lead to 'The resource you are looking for has been removed, had its name changed, or is temporarily unavailable'

Edward Sun (US) 0 Reputation points
2023-09-28T15:38:59.8966667+00:00

Access sub page will get 'The resource you are looking for has been removed, had its name changed, or is temporarily unavailable'

After further investigation we found it related to the Cookies: ARRAffinity and ARRAffinitySameSite, after remove these cookies the page will be available.

But after the two cookies add back again automatically, open new page still get the same error message.

I want to understand what happened in the Web App service and what will cause this issue?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,984 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,381 Reputation points Moderator
    2023-10-06T23:38:46.82+00:00

    Hi @Edward Sun (US) thanks for the question.

    When a client makes a request to an Azure App Service, the request is routed to one of the available instances of the app service. The ARRAffinity and ARRAffinitySameSite cookies are then set by the app service to ensure that subsequent requests from the same client are routed to the same instance.

    There are a few reason why you're seeing the error message "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable" when accessing a sub-page of your azure web application:

    • If the ARRAffinity and ARRAffinitySameSite cookies are being sent with subsequent requests from the same client, but are not being recognized by the app service, the request may be routed to a different instance, which may not have the session state for the client.
    • If the ARRAffinity cookies have a different domain value, the browser will take it as different cookies. This can cause issues if the first ARRAffinity value is invalid due to the instance being removed from the service plan (by scale in or UD walk), as the FrontEnd will try to find a new valid worker instance with a new ARRAffinity value for the client. However, this new ARRAffinity value will always be saved into the second subdomain’s cookies, which cannot be picked up by the App Service FrontEnd.

    To troubleshoot this issue, you can try the following steps:

    1. Ignore the domain name and keep only one ARRAffinity Cookies at the client side
    2. Update the App Service FrontEnd to pick up the ARRAffinity, which has the same domain name as the request has.
    3. If your app isn’t scaled to multiple instances, or doesn’t use in-process session, you can disable the affinity cookie from the App Service Configuration blade (under General Settings). See this SO thread

    For more troubleshooting tips please see this blog post: Session lost due to ARRAffinity Cookies

    Hope this helps. please let us know if you have further questions.

    -Grace

    1 person found this answer helpful.

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.