Front door function change origin

Conrad 40 Reputation points
2024-02-22T15:24:03.2433333+00:00

I have an azure front door configuration that routes all requests to an origin which executes an azure function. That function queries a third party with the details about the request and needs to determine if the response should be redirected or sent to another origin. Once a function is invoked, can that function restart the request and match a different routing rule or can a different origin be specified that the request should be sent to? Essentially, I want the function origin to be able to pass thru the request to a different origin or modify the headers and have it handled again by front door and route to the other origin.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,323 questions
Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
584 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pramod Valavala 20,591 Reputation points Microsoft Employee
    2024-02-22T16:12:41.0066667+00:00

    @Conrad While it is not possible to modify the original request once it has been forwarded to your function app, you can approach this in one of the two following ways

    • Have your function app make the call itself (forwarding any headers it must from the originating request)
    • Return a response with a redirect status code like 307 with a Location header set to the new URL. Most HTTP Clients have built-in configurable redirect handling that your clients can leverage.

0 additional answers

Sort by: Most helpful