8
Views
1
Comments
[AppInsights] Error getting the signed-in user
appinsights-oml
Reactive icon
Forge asset by Arun Kumar
Application Type
Reactive

Using this library we are sending information from the client side of my OutSystems application to AppInsights. Calling the "Init" and "SetAuthenticatedUserContext" client actions from the OnApplicationReady of my UI module.

We are also using Application Management Dashboard to monitor applications. And we realized a difference in the number of users, getting less with AppInsights.

We think that the problem is that the OnApplicationReady event fires after the module loads. Initially there is no user information since we are not authenticated in OS (UserId=0). We believe this is what is causing users in AppInsights to go uncounted.

Where should we call the "SetAuthenticatedUserContext" client action to get correct results? 

2025-09-13 09-26-34
Sebastian Marten

According to Application Insights API for custom events and metrics - Azure Monitor | Microsoft Learn, you should call this after a user has been authenticated. Wherever you do your login, call it once a user has successfully logged in.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.