I created an Azure API Management (APIM) instance with a POST operation. when I attempt to pass a payload larger than 1MB .I encounter a '413 Payload Too Large' error" in Azure APIMS

akhila 25 Reputation points
2023-10-06T05:55:51.1733333+00:00

I created an Azure API Management (APIM) instance with a POST operation. when I attempt to pass a payload larger than 1MB .I encounter a '413 Payload Too Large' error" in Azure APIMS

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

Accepted answer
  1. navba-MSFT 17,735 Reputation points Microsoft Employee
    2023-10-06T07:39:57.2833333+00:00

    @akhila Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    I understand that you are encountering the '413 Payload Too Large' error in Azure API Management (APIM) when attempting to pass a payload larger than 1MB.

    The APIM limits are documented here for request limits.

    User's image

    This limit applies to the Consumption tier only. There are no specific limits in other tiers but depends on service infrastructure, policy configuration, number of concurrent requests, and other factors. Could you confirm if you are on this tier? Otherwise there is no such limit.

    So the payload restriction is present only in the Consumption Tier as mentioned in the docs. Do you have any APIM policies to check the request body size and restrict such requests ?

    When a large request is sent to Azure API Management (APIM), the request is temporarily stored in memory while it is being processed. If the request is too large to fit in memory (more than the above mentioned limits), APIM will return an HTTP 413 Payload Too Large response to the client.

    First you need to check and isolate if the 413 error is thrown by APIM or the backend service. This can be checked from the APIM metrics as shown below:

    Select the Requests metrics and then Apply Splitting. Select Backend Response Code and Gateway Response Code as shown below:

    User's image

    If the 413 error is thrown by the backend, then you need to investigate it further.

    If you need any help to check if 413 is thrown by APIM or the backend service, please send an email to azcommunity[at]microsoft[dot]com with with subject as "Attn: Naveen' so that we can further check internally on this issue.

    Could you please share the below details over email ?

    1. Your APIM Resource details in below format:

    /subscriptions/XXXXXXXXX/resourceGroups/RGName/providers/Microsoft.ApiManagement/service/APIM_NAME

    1. APIM sku
    2. APIM resource region
    3. Time of the issue ( 413) error in UTC.

    Awaiting your reply.

    **
    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

0 additional answers

Sort by: Most helpful