URL Rewrite in Azure APIM

Anant 60 Reputation points
2023-08-23T09:03:30.88+00:00

Hi,

I have added API in APIM with below url -

https://<custom_domain>/<url_suffix>/<Api_function>

https://localhost:759/wp/api/v3/doc

but my URL where the hit will come is -

https://<custom_domain>/<Api_function>

https://localhost:759/api/v3/doc

When I have added below URL rewrite in inbound policy followed by <base />, I am getting 404

<rewrite-uri template="/wp@(context.Request.Url.Path)" />

How can I manage url suffix in APIM ?

Whether will add url_suffix in API side or need to do changes in APIM policys .

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,371 questions
0 comments No comments
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 29,246 Reputation points
    2023-08-23T11:08:26.8966667+00:00

    Hi Anant Thanks for reaching out. Please refer this SO thread which addresses this issue https://stackoverflow.com/questions/54314693/azure-apim-rewrite-uri-policy-how-to-remove-the-url-suffix

    let me know incase of further queries, I would be happy to assist you.

    Please "upvote/accept" if the answer is helpful so that it can help others in the community.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.