Manage versioned API in Azure API Manager

喜夏-厌秋 提交于 2019-12-06 11:02:20

It depends on how you configure your version set. Initially each API in Azure APIM has only URI suffix - i.e. part of the path coming right after host to identify API called. When you add API to a version set and set this version set's scheme to "path" you additionally specify version string for each API. look into your API's settings, there should be a field called "Version identified". This identifier is appended to API URL suffix automatically.

So imagine you have an API with suffix of "httpbin" and you add it to a version set and set it's version identified to "v0" that means that this API will be reachable by calling https://xxx.xxx/httpbin/v0/...

Looking at your configuration. I have a feeling that you've put "api/v1" as both API suffix and version identifier. Try splitting it into "api" as API suffix, and "v1" as version identifier.

To be able to identify the issue, it would be helpful to have the api-part of the automation script. In that way we can see what APIM actually uses as ARM template regarding the linked version 1 and 2 of the APIs.

So I realized in APIM there is no version set created at all: The resulting APIs from my above template scripts

I then created version set manually and linked to my 2 swaggers in the Azure portal and then it looks correct: Manually created in portal

But even when creating the version manually I have the same problem with the URL. I need to duplicate "api/v2/api/v2/[controller]"

The settings for version2 now looks like this which seems correct to me: enter image description here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!