I've created a custom User Attribute called "role" in Azure AD B2C.
I'm trying to update this using Microsoft.Graph 5.6.0
using this documented approach:
var user = new User
{
AdditionalData = new Dictionary<string, object>
{
{ $"extension_{_extensionAttributeId}_role", roleName }
}
};
await _graphServiceClient.Users[userId].PatchAsync(user);
This results in an exception with the underlying message: Resource '' does not exist or one of its queried reference-property objects are not present
The strange thing is that the message does not even have a Guid in it (as you can see above). So I have no idea what it is complaining about.
I am able to get the user correctly with the below code:
var user = await _graphServiceClient.Users[userId].GetAsync();
So at least it is able to find the user.