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:
- Ignore the domain name and keep only one ARRAffinity Cookies at the client side
- Update the App Service FrontEnd to pick up the ARRAffinity, which has the same domain name as the request has.
- 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