Unified Group creation fails using Microsoft Graph app-only calls when group naming policy is set.

Brass Contributor

We are running into an issue trying to create Unified groups in our custom provisioning process (c# based) if there is a group naming policy set up. We are using Microsoft Graph in app-only context through the PnP Core library CreateUnifiedGroup() method which, in turn, uses the standard .NET Graph client and similar issue comes when we use graph api call.

await graphClient.Groups.Request().AddAsync(newGroup);
Current Policy:
<Group name>(<Company>) - Here Company is azure ad user attribute
Error Message:
Code: Request_BadRequest Message: The property is missing a required prefix/suffix per your organization's Group naming requirements. Details: Detail0: Code: MissingPrefixSuffix Target: displayName AdditionalData: suggestedPropertyValue : sid-12-18-2021(MyCompany)()

 Payload

Payload.png

The prefix and suffix requirement setting is set as follows Prefix and Suffix requirement. I discovered the issue only occurs when the group naming policy uses User fields tokens (e.g. [Department], [Company], ...). If I don't use then, then the check passes.

 

Registered azure App have enough permission set to create a groups.

 

What would be the root cause of the issue.

 

Thanks.

BR. Sid

 

 

0 Replies