Azure APIM 作为纯代理



我正在尝试处理一个后端API(REST(,没有通过Azure APIM访问的招摇文档。 我希望所有指向后端 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>

' 然而,当击中 APIM 时,我得到了

{ "statusCode": 404, "message": "Resource not found" }任何帮助不胜感激谢谢

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

最新更新