gpt4 book ai didi

Azure API管理: Adding multiple Backend policies not allowed

转载 作者:行者123 更新时间:2023-12-03 02:18:43 26 4
gpt4 key购买 nike

我尝试将多个后端策略添加到我的 Azure APIM 管理终结点,但收到一条错误,指出我只能有一个策略:“第 xx 行第 6 列上的元素“后端”中出现错误:后端部分”只允许指定一项策略”

<backend>
<forward-request />
<set-header name="Content-Type" exists-action="append">
<value>application/json</value>
</set-header>
<set-header name="x-correlation-id" exists-action="append">
<value>asdf-qwer-1234-zxcv</value>
</set-header>
</backend>

是否可以设置多个后端策略?如果是这样,我该怎么做?如果没有,有哪些可能的解决方法?

最佳答案

感谢 Vova 和 DeepDave-MT 的快速回复!这些是类似的问题,但不一定与多个后端策略相关,而是与多个后端相关。

我们想通了!一位同事建议将策略移至入站策略。这相当有趣,我不会猜到这一点。

以下是这个技巧的示例:

<policies>
<inbound>
...
<set-header name="Content-Type" exists-action="override">
<value>application/json</value>
</set-header>
<set-header name="x-correlation-id" exists-action="override">
<value>asdf-qwer-1234-zxcv</value>
</set-header>
</inbound>
<backend>
<forward-request />
</backend>
<outbound>
...
</outbound>
<on-error></on-error>
</policies>

关于Azure API管理: Adding multiple Backend policies not allowed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70013283/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com