Azure Insights遥测未在所有事务上显示身份验证ID [英] Azure Insights telemetry not showing Auth ID on all transactions

查看:106
本文介绍了Azure Insights遥测未在所有事务上显示身份验证ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Azure Insights遥测与我们的SPA集成在一起,并尝试添加经过身份验证的用户跟踪.为此,登录后,我呼叫ReactAI.ai().setAuthenticatedUserContext(user_id).我可以在该特定跟踪上看到user_id,但在后续跟踪上看不到.如果我在该跟踪中获取了会话ID,则可以重新构造用户旅程,但理想情况下,它不希望通过额外的步骤来确定会话ID.

I'm trying to integrate Azure Insights telemetry with our SPA and trying to add authenticated user tracing. For this, after logging in, I call ReactAI.ai().setAuthenticatedUserContext(user_id). I can see the user_id on that specific trace, but not on subsequent ones. If I grab the session id in that trace, I can reconstitute the user journey, but would ideally like to not go through the extra step of figuring out the session id.

推荐答案

该方法的完整签名为:

setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string, storeInCookie = false)

您需要将storeInCookie设置为true,以确保在跟踪之间保留UserId.

You would need to set storeInCookie to true to make sure UserId is preserved across traces.

根据新的cookie法规,该cookie在cookie审核时被标记为非必需,并且不能是默认情况下的cookie.我认为,如果您删除此内容,则需要在网站上输入"Cookie声明".

This cookie was marked as non-essential upon cookies review as per the new cookie laws and could not be an on-by-default cookie. I think you'd need "Cookie statement" on the site if you'd drop this.

这篇关于Azure Insights遥测未在所有事务上显示身份验证ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆