如何使用订阅 ID 以外的自定义 api 键在 azure api 管理中使用速率限制?

How to use rate limit in azure api management by using custom apiKey other than subscripon id?

使用

可以很容易地对 api 进行速率限制
<rate-limit-by-key calls="3" renewal-period="15" counter-key="@(context.Subscription.Id)" />

但我需要通过使用 api 密钥作为请求参数发送来限制 api 的速率。

参见此处:https://docs.microsoft.com/en-us/azure/api-management/api-management-policy-expressions#ContextVariables 了解上下文变量文档。