Search code examples
azureazure-web-app-serviceweb-config

301 Redirect - Two Azure Web Apps


I have an application running on old-example-app.azurewebsites.net. I want to setup a redirect from that application to another one in Azure that is new-example-app.azurewebsites.net. I want to accomplish this without having to make a code change and redeployment because I don't have deployment slots and my old-example-app has a lot of active users. Is there any setting I can enable or modify on the web app settings in Azure or am I stuck making a new deployment?


Solution

  • You can make use of Azure Application Gateway with Multi-site listener to route 2 URL's between your old azure web app and new azure web app.

    enter image description here

    enter image description here

    In your backend pool, Add 2 backend pools 1 for old-example-app.azurewebsites.net App and 2nd for new-example-app.azurewebsites.net like below:-

    My App1:-

    enter image description here

    My App2:-

    enter image description here

    enter image description here

    Now, Create a routing rule to route the URL's for both the Backend targets like below:-

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    Refer my SO thread for more details.