1

I am trying to create api and expose them via APIM. The path of the api that I expect is baseUrl/v1/Product/Upload.

But when i try to use versioning of APIM, I could only come up with something like baseUrl/Product/v1/Upload, where Product is API url suffix.

Is there a way in APIM to change the order in which version number is placed in the url path.

venkatesh k
  • 49
  • 1
  • 9

1 Answers1

1

Every API Developer will have their own requirement of versioning. So Azure API Management provide several options instead of a single approach to versioning. And Path-based versioning is one of those options.

If you check this Path-based versioning section of Microsoft document then you will find -

When the path versioning scheme is used, the version identifier needs to be included in the URL path for any API requests.

The format of an API request URL when using path-based versioning is as follows.

https://{yourDomain}/{apiName}/{versionIdentifier}/{operationId}

It is recommended to follow this format but if you want to modify it you can use the API Management transformation policies. The rewrite-uri policy converts a request URL from its public form to the form expected by the web service.

Read this Rewrite URL and Policy Expressions in Azure API Management document for more information.

SauravDas-MT
  • 1,224
  • 1
  • 4
  • 10
  • Thanks for writing up in detail. The apis are already availabe to the consumers as baseUrl/v1/Product/Upload. And I don't want consumers to change the structure. – venkatesh k Nov 20 '21 at 16:00
  • Have you checked the API Management transformation policies. – SauravDas-MT Nov 22 '21 at 03:51
  • 1
    I am referring to the api url that will be exposed from apim not the one that is connect to apim as backend. I don't think rewrite policies (if that is what you are referring at) will help – venkatesh k Nov 23 '21 at 16:55