The UserContext class provides 3 properties to identify the user. They are: AccountId, AuthenticatedUserId and Id.
What's the difference between them?
The UserContext class provides 3 properties to identify the user. They are: AccountId, AuthenticatedUserId and Id.
What's the difference between them?
At least from a docs perspective, this is what they mean:
AuthenticatedUserId: In a web app, users are (by default) identified by cookies. A user might be counted more than once if they access your app from a different machine or browser, or if they delete cookies. You can thus get a more accurate count by setting the authenticated user ID in the browser code.
Note: The user ID is also set in a session cookie and sent to the server. If the server SDK is installed, the authenticated user ID is sent as part of the context properties of both client and server telemetry. You can then filter and search on it.
AccountId: In multi-tenant applications this is the account ID or name, which the user is acting with. Examples may be subscription ID for Azure portal or blog name for a blogging platform.
References:
Hope this helps.