Why, increasing Azure plan, it returns a 301 Moved Permanently with same request/location url?

Marco Dalla Piazza 5 Reputation points
2023-09-01T13:04:42.6466667+00:00

Hi,

I've made and update of my Service Plan (P3v2) on Azure, and from that moment the server has been returned to clients 301 Moved Permanently, unfortunately with the same request/location url (didn't of course change the dns of my app).

This way, the browser has cached it up (forever), taking from that moment the "new" url from the disk (I see the message 301 Moved Permanently (from disk cache)); since both url are the same, it introduce lots ot "too many redirects" problems for many of customers.

The only solution seems to clear the cache from client (which is bad for customers).

Why it has done such a edit? I want to avoid it in the future. Bug?

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

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 17,576 Reputation points Microsoft Employee
    2023-09-04T02:31:09.51+00:00

    @Marco Dalla Piazza When you update your Service Plan, Azure may move your App Service to a different server or change the IP address associated with your App Service. This can cause the URL for your App Service to change, which can result in a 301 Moved Permanently response.

    To avoid this issue in the future, you can try the following:

    1. Use a custom domain: If you use a custom domain for your App Service, you can avoid issues with URL changes caused by Service Plan updates. When you update your Service Plan, Azure will automatically update the IP address associated with your custom domain, so your customers will not experience any issues.
    2. Use a CNAME record: If you cannot use a custom domain, you can use a CNAME record to map a subdomain to your App Service. This will allow you to update the IP address associated with the subdomain without changing the URL.

    While you do not say in your post, it sounds like an IP address is being used. We never recommend using an IP address but instead we recommend using the CNAME as this will persist even if your inbound IP address changes.


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.