Application gateway - Hide backend URL

Ted 191 Reputation points
2020-07-23T17:10:40.45+00:00

Hello,

I have an application hosted on Azure App Services using the .azurewebsites.net default url.
I deployed an Application Gateway as WAFv2 to get in front of the application. The rules work, I can browse to the application using the Application Gateway frontend. The thing is the url I get when redirected to the backend is the .azurewebsites.net and I would like to show my own domain when browsing through the Application Gateway public endpoint.
The DNS is setup correctly, browser to xxx.mydomain.com is sending me correctly to the Application Gateway but then I get the .azurewebsites.net url in my browser.
How can I change this behavior on the Application Gateway ? Is the Rewrite feature the solution ?
Should I import my custom DNS in the App Services ?

What is the best practice ?

Thank you in advance

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
961 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,908 questions
{count} votes

2 answers

Sort by: Most helpful
  1. TravisCragg-MSFT 5,676 Reputation points Microsoft Employee
    2020-07-25T00:46:47.103+00:00

    @Ted This is a common issue when using an Application Gateway with an Azure App Service, and this is resolved using header re-writes.

    Here is a great doc that explains the scenario about modifying redirection URLs, and the best practices for redirecting.


  2. Ted 191 Reputation points
    2020-07-30T09:03:35.997+00:00

    So actually I found out that the URL rewrite doesn't work when using Redirect in the rules. It seems to work for Backend Pools.
    It doesn't help me in this case as the App Services is in another Subscription so I can't use the Backend Pools. I'm getting stuck on that