How To correlate requests between Azure Application Gateway and Azure App Service?

Harsh Thakor 116 Reputation points
2023-10-03T10:12:49.55+00:00

How to correlate requests between Azure Application Gateway WAF V2 and Azure App Service, what is the common attribute other than the timestamp in the logs of log Analytics workspace between both services to track the request?

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
988 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,134 questions
Azure Startups
Azure Startups
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Startups: Companies that are in their initial stages of business and typically developing a business model and seeking financing.
36 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Thomas Meads 1,586 Reputation points
    2023-10-03T15:54:52.6833333+00:00

    Hi,

    To my knowledge this is not possible without some custom logging. Application gateway has a x-appgw-trace-id header which is attached to every request and is logged in the diagnostic settings output (assuming you have this setup). You could then log this header when your application receives a request and join on this when querying.

    When looking at application logs you will find a parent operation Id property and a operation Id property these are normally what are used to correlate between logs within an app. However I do not think that the parent Id of a request is automatically set to the trace headers sent by application gateway or AFD etc. I have not tested this though so it might be worth double checking this before setting up logging the x-appgw-trace-id header against requests to your app service.

    Hope this helps.

    0 comments No comments