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.
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.
suggestedPropertyValue : sid-12-18-2021(MyCompany)()
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.