Azure Api 管理:有什么方法可以在消费层中实施速率限制?

Azure Api Management: Any way to implement rate limiting in the consumption tier?

我想对 API 的呼叫进行“速率限制”。假设每个 API 键每分钟最多调用 5 次。我的 APIM 在消费 SKU 上。

但是在尝试添加策略时我得到

Error in element 'quota-by-key' on line 16, column 10: Policy is not allowed in 'Consumption' sku

同理

Rate-limit-by-key Policy is not allowed in 'Consumption' sku

有什么方法可以在消费层上使用速率限制吗?

发现在消费层上您只能在 API 级别设置速率限制或使用限制,而不能在产品级别设置。

速率限制

<policies>
        <inbound>
            <base />
            <rate-limit calls="5" renewal-period="60" remaining-calls-variable-name="remainingCallsPerSubscription" />
        </inbound>
        <backend>
            <base />
        </backend>
        <outbound>
            <base />
        </outbound>
        <on-error>
            <base />
        </on-error>
    </policies>

使用配额:

<policies>
    <inbound>
        <base />
        <quota calls="10000" renewal-period="3600" />
    </inbound>
    <outbound>
        <base />
    </outbound>
</policies>

来源:https://social.msdn.microsoft.com/Forums/azure/en-US/7dbd5ee3-2b20-4721-b5a8-84d524557fe6/error-policy-not-allowed-in-this-sku-consumption?forum=azureapimgmt