简体   繁体   English

Azure API管理 - API端点域与实际API URL

[英]Azure API Management - API End-Point Domain vs Actual API URL

I have setup an Azure API Management Service and its configured on a custom domain. 我已经设置了一个Azure API管理服务,并在自定义域上配置了它。 Under the API Management Service's Configure Section in the Azure Portal, I have set the following: 在Azure门户中的API Management Service的配置部分下,我设置了以下内容: API管理服务 - 配置

Because this is a client system, I have to block out the details but here are the basics: 因为这是一个客户端系统,我必须阻止细节,但这里是基础知识:

  • API ENDPOINT DOMAIN: api.example.com API ENDPOINT域名:api.example.com
  • DEVELOPER PORTAL DOMAIN: apiportal.example.com 开发者门户域名:apiportal.example.com
  • There is a SSL uploaded for both. 已为两者上传了SSL。

Because I have the Type Set to Custom, I am required to enter both the API ENDPOINT and the DEV PORTAL. 因为我将Type设置为Custom,所以我需要输入API ENDPOINT和DEV PORTAL。

When I go into the Publish Portal and setup the API I get this: 当我进入发布门户并设置API时,我得到了这个: API发布商门户 -  API设置

I need to be able to run a single Developer Portal but have 2 different API Servers (1-Sandbox, 2-Production) yet they will have different sub-domains (api-sandbox.example.com & api.example.com) 我需要能够运行单个Developer Portal但有2个不同的API服务器(1-Sandbox,2-Production)但它们将具有不同的子域(api-sandbox.example.com和api.example.com)

Is this possible? 这可能吗? Why is the API Settings overriding the Web Service URL/URL Suffix with what I put int the API Management Configure? 为什么API设置会覆盖我在API Management Configure中放置的Web服务URL / URL后缀?

Web service URL property is used to specify the backend URL for a specific API. Web服务URL属性用于指定特定API的后端URL。 That URL is considered private and should be used by the API Management gateway component only for forwarding requests sent to the public URL you defined for your tenant. 该URL被视为私有,并且API管理网关组件仅应将其用于转发发送到您为租户定义的公共URL的请求。 So, the behavior you are observing is by design. 因此,您正在观察的行为是设计的。 You should manifest your two backends as two distinct APIs in API Management. 您应该将两个后端显示为API Management中的两个不同的API。

或者,您可以使用带有逻辑的SetBackendService策略 ,例如,如果请求具有特殊的标头或查询字符串参数,或者其他内容。

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

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