In Azure all hosted sites have URL Rewrite and ARR (Application Request Routing) modules installed but the proxy functionality is disabled by default in ARR.

So, when you create a simple rewrite rule like the one that follows:

        <rule name="ProxyAdmin" stopProcessing="true">
            <match url="backend/api(.*)" />
            <action type="Rewrite" url="{R:1}" logRewrittenUrl="false" />

where, for example all the requests like `…` should be served by `http://api.yourdomain/api/…` will result in a 404 (Not Found) status code with the following message:

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

To overcome this issue and enable proxy functionality, we should follow three simple steps:

Step 1: Create an xdt transform file

<?xml version="1.0"?>
<configuration xmlns:xdt="">
		<proxy xdt:Transform="InsertIfMissing" enabled="true" preserveHostHeader="false" reverseRewriteHostInResponseHeaders="false" />

This file will override applicationhost.config, taking advantage of a feature in Azure, called Azure Site Extensions, that provides a mechanism to apply transforms to applicationhost.config using XDT transforms.


Step 2: Upload applicaitonHost.xdt to `site` directory of your web app



Step 3: Restart your web app for changes to take effect



Categorized in:

Tagged in: