Search code examples
azureazure-api-managementazure-front-doorapim

Azure Front Door to APIM. Rewrite folder to apim suffix


In Azure FrontDoor let's say I have the following domain: https://example.com

In Azure APIM I have an API with the suffix of "test-destination" (so when accessed directly via APIM the url is - https://apim-example.azure-api.net/test-destination)

In Azure FrontDoor I would like requests to https://example.com/test-source to be forwarded to the APIM "test-destination" API

Is that possible?


Solution

  • Yes, it is possible the desired routing configuration with Azure Front door and Azure API Management

    Create an Azure front door with backend pool as API Management like below:

    enter image description here

    In routing rule, enter the path pattern you want to route /test-source.

    enter image description here

    Then, configure the API Management instance to route requests to the test-destination. In API backend configuration enter the hostname of Front Door instance example.com in the Backend URL and the path of the API that you want to route to /test-destination .

    enter image description here

    To know more in detail, check these references:

    URL Redirect - Azure Front Door | Microsoft Learn

    Configure Azure Front Door in front of Azure API Management | Microsoft Learn

    Additionally, As per MsDoc you can use url rewrite to change the request path like below:

    enter image description here

    Make sure Associate rule set with route like below:

    enter image description here