Is there a way to query for remaining or used calls for a subscription based usage quota policy in azure api management?
I see https://learn.microsoft.com/en-us/rest/api/apimanagement/quotabycounterkeys/listbyservice but I don't see how to get remaining or used calls for https://learn.microsoft.com/en-us/azure/api-management/api-management-access-restriction-policies#SetUsageQuotaBySubscription as I don't know what to use for the quotaCounterKey
There is no way currently to get the remaining calls
But you can set quota using https://learn.microsoft.com/en-us/azure/api-management/api-management-access-restriction-policies#SetUsageQuota
Then use the quotaCounterKey
Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key
to determine the current value for a period. Then subtract from what you have configured.
The counter-key could be set to context.SubscriptionId.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With