Getting Message "Failed to generate sample value: generated sample is too big" when clicked on Test tab of the API on Azure APIM Portal

Omkar Ghodge 1 Reputation point
2022-12-27T11:14:15.2+00:00

When we visit azure portal->APIM, and browse an API and then try to use the Test tab where we can test various operations under the API, the sample request is not generated and instead we get Failed to generate sample value: generated sample is too big. This is happening for some APIs. Not sure what is the limit or which limit it is breaking. This also replicates when tried from Developer Portal.

274253-issue.png

Browse Azure Portal Go to API Management Service Select APIs section Select an API Select Test tab Click on the Operation Expectation was to see Request body with valid sample request But we get "Failed to generate sample value: generated sample is too big." in the Request body. This is happening only for selected APIs not for all and the API in question had aprx 4.5K properties in the request.

Need to understand what is the limit? I have validated that its not an UI client issue i.e. this message comes from server itself when providing the operation details.

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

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 9,296 Reputation points Microsoft Employee
    2022-12-28T03:59:56.673+00:00

    Hi @Omkar Ghodge Thanks for reaching out. I see you had mentioned that you have approx. 4.5k properties in the request, seems like the size of the sample being generated is very large. The APIM service has a maximum Sample size limit and it is 200kb, and if the sample is larger than this limit, the APIM service will return this error. "Failed to generate sample value: generated sample is too big" in this case you would need to create sample by your own.

    Feel free to add a comment if you have any other questions. We would be happy to assist you.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community.