资源“”不存在或其查询的引用属性对象之一不存在

akn*_*nag 2 c# azure-active-directory azure-ad-b2c microsoft-graph-api azure-ad-b2c-custom-policy

我在 Azure AD B2C 中创建了一个名为“角色”的自定义用户属性。
我正在尝试使用Microsoft.Graph 5.6.0以下记录的方法来更新此内容:

var user = new User
{
    AdditionalData = new Dictionary<string, object>
    {
          { $"extension_{_extensionAttributeId}_role", roleName }
    }
};
await _graphServiceClient.Users[userId].PatchAsync(user);
Run Code Online (Sandbox Code Playgroud)

这会导致底层消息出现异常:Resource '' does not exist or one of its queried reference-property objects are not present
奇怪的是,该消息中甚至没有 Guid(如上所示)。所以我不知道它在抱怨什么。

我可以使用以下代码正确地获取用户:

var user = await _graphServiceClient.Users[userId].GetAsync();
Run Code Online (Sandbox Code Playgroud)

所以至少它能够找到用户。

akn*_*nag 5

-没关系,我只是忘记从扩展应用程序 ID 中删除所有内容。现在可以了。\xe2\x80\x8d\xe2\x99\x82\xef\xb8\x8f

\n