I have this in my inbound policy:
<choose>
<when condition="@(context.Subscription.Name=="someName")" />
<when condition="@(context.Subscription.Name=="otherName")" />
<otherwise>
<rate-limit calls="50" renewal-period="300" remaining-calls-variable-name="remainingCallsPerSubscription" />
</otherwise>
</choose>
It does not seem to work as intended, throttling also the above named subscriptions, am I missing something?
p.s. I am on the consumption model
I have used the same policy to exempt the subscription keys which are being used from
rate-limitpolicy.For testing purpose, I have taken 10 calls.
While testing, you need to pass the subscription key name is Ocp-Apim-Subscription-Key and the value will be the value of your subscription key or else it will fetch the value of
context.Subscription.NameasBuilt-in all-access subscriptionby default.When the value of
context.Subscription.Nameis false, I am getting expected response as shown below.In order to get the expected response, please make sure you don't have any other policy defined at global or API level.