3
votes

Attempting the following routing with our Azure Front Door:

Assume the Front Door URL is https://foo.azurefd.net, and the backend pool consists of an Azure Web App with URL https://foowebapp.azurewebsites.net.

I have created a routing rule as follows:

User passes POST: https://foo.azurefd.net/api/token/12345

I want that to get directed to POST: https://foowebapp.azurewebsites.net/api/token

I created the rule using Redirect route type. The problem is I get a 405 Method Not Allowed when passing this via the Front Door. If I pass directly to the https://foowebapp.azurewebsites.net/api/token endpoint, I get the expected response.

Why is this happening, and is there another setting in Front Door I need to tweak?

EDIT: I can see now in analyzing the traffic that Front Door is changing the method from POST to GET during the redirect. This is why I'm getting the 405 Method Not Allowed error. But I don't understand why Front Door would change it from a POST to GET. Everything is set to HTTPS only. I have raised this with Azure support but not sure I expect much assistance from them.

1

1 Answers

4
votes

Figured it out. By default, Front Door's redirect is set to type 302 (Found). This kind of redirect will always change any non-GET method to a GET. Using either 307 (Temporary Redirect) or 308 (Permanent Redirect) will allow the call to be passed without change the method.