Azure API Management HTTP 429 (Too many requests)

tamas-kr 56 Reputation points
2024-04-09T09:10:18.6533333+00:00

Hi,

I have an API Management instance (Consumption, US West) that occasionally started responding with HTTP 429 (Too many requests).

The APIM instance forwards my requests to an Azure Function App (Y1, US West) but confusingly, the throttled requests don't originate from the function app which suggests the throttling occurs in API Management. There is no rate-limit policy set on the APIM instance and I'm not really sure what causes the request throttling.

Is there any way to get more details about these failed requests and what causes them?

App Insights logs:

APIM:

User's image

Function App:

User's image

Any help would be appreciated!

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,991 Reputation points Moderator
    2024-04-10T05:28:28.22+00:00

    @tamas-kr Thanks for reaching out.

    APIM does not have default rate-limit policy and hence usually 429 come from backend or with rate-limit policy defined in API. Based on the request info you shared, 429 errors were returned by backend API (azure Functions) and not APIM.

    Limit Doc reference: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#api-management-limits

    As you have already validated that you don't have the rate limit policy. It looks like the request is being rejected from the function app front end and not reaching the function that is the reason you may not see the 429 error at your function app end. Have you tried reviewing the OCP APIM traces reproducing the issue as this will confirm whether APIM is getting 429 error from your backend or not.

    I will also suggest to review the Diagnose and solve problems blade on your function app to review if there was SNAT Port Exhaustion issue as this could be one of the reasons for 429 error return to APIM from function app. You can also review other detector in your function app for any issue.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.