gpt4 book ai didi

Azure Active Directory - 更新用户 - 目标实体集当前不支持该请求

转载 作者:行者123 更新时间:2023-12-03 00:27:54 26 4
gpt4 key购买 nike

我们正在使用 Azure AD 和其他 Azure PaaS 服务开发基于微服务的架构解决方案。

好处是,我们能够使用 Microsoft.Graph SDK for .NET Core 2.1,并且能够进行身份验证并在 Azure AD 中创建用户。

问题是我们无法更新用户个人资料。 GraphServiceClient 为我们提供了一种更新用户的方法,但是我们收到了 BadRequest ,其中包含错误消息 目标实体集当前不支持该请求

我还在线尝试了 Graph Explorer,我注意到更新用户不在那里。那么我们如何合并配置文件更新呢?

非常感谢。

// you have user object from AD and now you want to set some fields to update
user.Birthday = request.DateOfBirth;
user.PostalCode = request.Zip;

user = await _graphClient.Users[user.Id].Request().UpdateAsync(user);
// _graphClient is a GraphServiceClient instance

最佳答案

您的代码与他们的example here相匹配,但您设置了user.Id。也许它正在尝试更新Id,这就是它抛出错误的原因。尝试不设置 user.Id 并使用不同的变量来存储传递给 Users[] 的 ID。

关于Azure Active Directory - 更新用户 - 目标实体集当前不支持该请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53540501/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com