有没有办法设置 APIM 策略以使用 'x-functions-key' 在请求 header 中发送 Azure Function API 键而不是从查询参数发送它?

Is there a way to set APIM Policy to send Azure Function API key in request header using 'x-functions-key' instead of sending it from query parameter?

有没有办法设置 API 管理策略以使用 'x-functions-key' 发送请求 header 中的 Azure Function API 键而不是从查询参数发送它?

set-header 策略可用于设置 http headers 的值。更多信息 -> DOCS

示例:

<set-header name="some header name" exists-action="override">
    <value>20</value>
</set-header>

在函数应用程序导入期间 API创建了 M 个后端实体:https://docs.microsoft.com/en-us/rest/api/apimanagement/backend/createorupdate 该实体包括对存储在属性中的键的引用。您可以使用 rest API 来获取当前的查询并将键从查询移动到 header.