Thanks for posting your question in the Microsoft Q&A forum.
Here's how to set up a system to display API call failures with their associated backend errors:
- Enable Application Insights integration with APIM
- Configure APIM to log request and response payloads:
- Navigate to your API in the Azure portal
- Under
Settings
, enableFrontend Request
andFrontend Response
logging - Set the number of payload bytes to log
- Use correlation IDs to link APIM and backend logs:
- Implement a policy in APIM to generate and forward a correlation ID
- Ensure your backend WebApp logs this correlation ID with each request
- Log backend errors in Application Insights:
- Configure your WebApp to send detailed error logs to Application Insights
- Include the correlation ID in these logs
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful