简体   繁体   English

Azure API管理直通到后端服务

[英]Azure API Management passthrough to backend service

I would like to setup an Azure API Gateway that accepts requests for a backend service and simply passes the requests through to the backend with no modification. 我想设置一个Azure API网关,该网关接受对后端服务的请求,并将请求直接传递给后端,而无需进行任何修改。 For example: (-> means it would get routed to) 例如:(->表示将被路由到)

https://dude.azure-api.net/foo -> https://realapi.mycompany.com/foo https://dude.azure-api.net/foo- > https://realapi.mycompany.com/foo

https://dude.azure-api.net/bar -> https://realapi.mycompany.com/bar https://dude.azure-api.net/bar- > https://realapi.mycompany.com/bar

etc 等等

I want to use wild cards to set this up so that I don't have to specify every single endpoint in every single API. 我想使用通配符进行设置,这样就不必在每个API中都指定每个端点。

This is very, very similar to Use Azure Api Management as a passthrough 这与使用Azure Api管理作为传递非常非常相似

however, I have a combination of GET's and POST's so that accepted solution won't work. 但是,我将GET和POST结合使用,因此无法接受已接受的解决方案。

Can anyone tell me how to do this? 谁能告诉我该怎么做?

You will have to create wildcard operation per HTTP method. 您将必须根据HTTP方法创建通配符操作。 For sample above you could create two APIs, one with /foo suffix, and another with /bar. 对于上面的示例,您可以创建两个API,一个带有/ foo后缀,另一个带有/ bar。 Both should have two operations - GET and POST - with "/*" as URI template. 两者都应该有两个操作-GET和POST-以“ / *”作为URI模板。

Alternatively if you want complete passthrough - create single API with "/" suffix and two operations - GET and POST - both with "/*" URI template. 或者,如果您希望完整的传递-使用“ /”后缀创建单个API,并使用“ / *” URI模板创建两个操作-GET和POST。

要获得完整的传递,您只需指定“ /”作为API URL后缀

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM