venkatesh k
venkatesh k

Reputation: 59

Azure APIM versioning changing the path

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.

Upvotes: 1

Views: 1349

Answers (1)

SauravDas-MT
SauravDas-MT

Reputation: 1440

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.

Upvotes: 1

Related Questions