Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query quota for subscription

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

like image 695
rggammon Avatar asked Nov 18 '25 12:11

rggammon


1 Answers

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.

like image 175
Samir Avatar answered Nov 21 '25 03:11

Samir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!