Hi Marta Dubas
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
First, collect the relevant data from the ApiManagementGatewayLogs, focusing on the CorrelationId.
let apimLogs = ApiManagementGatewayLogs
| project TimeGenerated, CorrelationId, ApiName, RequestUri;
Next, collect data from Application Insights requests, where the CustomProperties.RequestId is located.
let apimInsightsRequests =
requests
| extend RequestId = tostring(customDimensions.RequestId), RequestCorrelationId = tostring(customDimensions["Request-x-correlation-id"])
| project TimeGenerated, RequestId, RequestCorrelationId;
For reference, please review this documentation :-
https://yourazurecoach.com/2021/01/22/optimizing-api-traceability-in-azure-api-management/
https://learn.microsoft.com/en-us/azure/azure-monitor/reference/queries/apimanagementgatewaylogs
you have any further queries, do let us know.
If the answer is helpful, please click "Upvote it".