Azure APIM作为纯代理

时间:2017-08-14 01:52:13

标签: azure azure-api-management

我正在尝试处理后端API(REST),没有通过Azure APIM访问的swagger文档。 我希望所有调用指向Backend API的调用都不是为所有资源手动创建GET / PUT / POST。我对所有操作的入站政策如下 '



<policies>
  <inbound>
    <set-variable name="requestPath" value="@(context.Request.Url.Path)" />
    <base/>
    <set-backend-service base-url="https://*****/****/" />
    <rewrite-uri template="@(context.Request.Url.Path)" copy-unmatched-params="true" />
  </inbound>
  <backend>
    <base/>
  </backend>
  <outbound>
    <base/>
  </outbound>
</policies>
&#13;
&#13;
&#13;

` 然而,当我获得APIM时,我获得了

{ "statusCode": 404, "message": "Resource not found" } 任何帮助表示赞赏谢谢

1 个答案:

答案 0 :(得分:3)

执行此操作的简便方法是为您支持的每个HTTP方法创建一个操作,并使用/*作为模板。这将匹配任何入站路径/查询并将其转发到后端。