FrontDoor URL for Private Link do not work on setting HTTP_X-Forwarded-Host in HTTP_HOST header

Alok Kumar 0 Reputation points
2023-05-16T10:33:09.0533333+00:00

We have created an endpoint on Azure Front Door to access .azurewebsites.net through private link, and in my app service's web config I have created below rewrite rule to set HTTP_HOST value same as HTTP_X-Forwarded-Host. After adding this rule my Front door URL stops working. However as soon I remove this rule, front door url starts working. Issue is with Private link only. As soon as I route from public network, rewrite rule works as expected. Can you please suggest?


Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
613 questions
Azure Private Link
Azure Private Link
An Azure service that provides private connectivity from a virtual network to Azure platform as a service, customer-owned, or Microsoft partner services.
481 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,175 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ben Gimblett 3,735 Reputation points Microsoft Employee
    2023-05-18T11:34:20.11+00:00

    Hi Alok - it might be worth trying again with a new resource group, new AFD premium and new web app with just a basic MVC app from visual studio template (you can of course remove these resources after) to get you into a "known" state

    In my example I used

    Az Web App (S1) on Windows and Net4.8
    Az Front Door premium - the only config was to add the web app as an origin and select to use private link
    New ASP NET MVC app in Visual Studio , right click publish to the web app (as this is a test and that's OK!)

    I tested following
    (1) Published The MVC code to the web app and tested it responds once published (GET on the index)
    (2) I checked the same page is now accessible via my front door premium profile
    (3) Applied the xdt on the web app as per blog post
    (4) modified my web config by adding the rewrite rule and re-published)
    (5) tested again direct on the web app, to the web app with postman (manually adding the x forward host header) and finally through front door

    As mentioned before i added a line in the index view to output the Context.Request.Url as a visual aid to the host value being re-written correctly.