0
votes

I am trying to add a rate-limit policy for an API management (per API Management access restriction policies) and I am not sure if I do something wrong or if documentation is not correct.

According to the documentation, the

  • Set usage quota by key
  • Limit call rate by key

are not available in consumption tier, but Limit call rate by subscription has no such notice, so it should work (plus Set usage quota by subscription can be set).

I have an Azure API Management, I have created a sample API and a product and in the policy of the product is:

<policies>
<inbound>
    <base />
    <quota calls="100" renewal-period="86400" />        
    <rate-limit calls="20" renewal-period="90" />  
</inbound>
<backend>
    <base />
</backend>
<outbound>
    <base />
</outbound>
<on-error>
    <base />
</on-error>
</policies>

When I click on Save, I get

One or more fields contain incorrect values:

Error in element 'rate-limit' on line 16, column 10: Policy is not allowed in this sku 'Consumption'

Is there a way to set the rate-limit (=am I missing something) for consumption tier or is the documentation not correct?

1
Have you added closing tag for </policies> in your document as I don't see it. rate-limit should work in consumption tier. I tried the same policy with my APIM instance hosted on consumption tier and it worked without any error:Ketan
Closing tag was missing, because of SO formatting. I have fixed the post and tried again just to be sure - no change (i.imgur.com/O9kvfEs.png). What location have you tried? I have North Europe, maybe that's the problem.jahav
I tried in south India. Can you try it in different location ?Ketan
I can repro the issue when deployed it in North Europe region. I will check this internally with APIM product group and update the thread with appropriate details.Ketan
I have tried southeast asia and it works there. Thanks.jahav

1 Answers

0
votes

There is an ongoing update, once complete (a few days at most) "rate-limit" will be enabled for Consumption SKU, "rate-limit-by-key" disabled.