Azure API Management, Quotas and Rates

Alberto De Natale
3 min readJul 31, 2019

--

Control how an API is used by developers is possible in Azure API Management by adopting two policies namely “Call Rate” and “Usage Quota”.

Rates are meant to control peaks. Quotas are meant to control volumes.

The policies are available to the API provider for the developer and not to the developer for their users.

The renewal period for quotas cannot be set to less than 3,600s, or one hour.

Setting Rates

Then:

I will try these settings:

This will instruct Azure to limit the number of calls to one per minute filtering per IP Address rather than API Subscription key:

It is also possible to choose if errors or unauthenticated would concur to increase the rate:

The policy will now appear set correctly together with the others:

Whenever the rate is too high the following response will be returned:

Setting Quotas

Quotas can be used by selecting the “Set usage quota by key” option.

The settings are similar to those for rates, however, also the bandwidth option is given and the renewal period will have to be at least 300 seconds:

This is the error returned when the quota is passed:

Custom Quota and Rates in Azure App Services

I could not find this concept for Azure App Services. For the free tier, there might be something similar but that cannot be customised:

By configuring auto-scaling something similar might be achieved.

Quotas and Rates in Azure Functions

Again I could not find anything similar. Paired with service buses however Azure Functions might be able to implement something similar as described here:

Summary

Setting quotas and rates is very easy with Azure API Management and that makes it the desirable gateway to control the traffic coming in your web application.

--

--

Alberto De Natale
Alberto De Natale

Written by Alberto De Natale

Alberto De Natale is a passionate tech-enthusiast software developer.

No responses yet