1

I am using Azure AppInsights in our FrontEnd (Angular app) and Backend API (.NET Core).

We need to have distributed tracing to tie together the telemetry recorded in the tables - PageViews, Dependencies, Requests, Exceptions, etc.

Now we see the logs being captured, however, what we are having issues with is,

  1. I need to add the authenticated used ID (user_AuthenticatedId) on the Front-End that carries over to backend logs in Requests and Exceptions tables. For this we are using the method "setAuthenticatedUserContext" in the angular app: reference

This is showing in the frontend logs (Dependencies table for example) in "user_AuthenticatedId" field, but does not carry over/stick with any of the backend logs.

  1. I need a single correlation ID (like an operation_Id) that remains the same between the frontend and the backend logs for a specific API call made by the FrontEnd to the backend in the LogAnalytic tables Dependencies (frontend logs), Requests (backend logs), and Exceptions(backend logs).

Unfortunately, the setAuthenticatedUserContext method used in (1) above, is interfering with operation_Id field. Because of this frontend logs are having an operation_Id value which is same as user_AuthenticatedId (the user's ID) and the backend logs have a different appinsights assigned operation_Id

enter image description here

user1220169
  • 805
  • 2
  • 9
  • 14

0 Answers0