An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Hi @jinxjer lee ,
Thanks for reaching out to Microsoft Q&A.
Unfortunately, Azure API Management cannot capture or display full large request bodies (1–10 MB), even conditionally on errors like 400. Logs and policies have strict size limits, so bodies get truncated.
Best approach is to log/store the full request body in your backend service (e.g., Blob Storage) and use a correlation ID from APIM to link failed requests to the stored payload.
- Log full request body in the backend:
- Move body capture out of APIM:
- Your backend (App Service / Function / Container):
- On 400 error =>store full request body in Azure Blob Storage, Database, Data Lake
- Use correlation IDs:
In APIM:
<set-header name="x-correlation-id" exists-action="override">
- Log this ID in APIM logs/ Backend logs (with full body)
- Then correlate APIM =>“request failed”, Backend =>“here is the full payload”
- Store payload externally before API call
- Client uploads payload =>Blob Storage
- API call sends only Blob URL / ID
- Backend retrieves payload if needed
- Partial logging in APIM
- You can log first 32–64 KB of body, Content-Length, Hash (SHA256). This gives Debug clues, No risk to gateway
Hope this helps!
If the resolution was helpful, kindly take a moment to click on and click on Yes for was this answer helpful. And, if you have any further query do let us know.