Skip to content

SAIFTRBL0020 ยท permalink

No group found matching specified filter for a business role

If the auth_corp deployment fails with No group found matching specified filter on data.azuread_group.role_assignments, a business role referenced in infra/auth/corp/config.yml has no Entra group for that environment. Create or deploy the business role in your project's corporate business roles repository for that environment, then re-run the failed stage.


๐Ÿšจ Symptom

The ๐Ÿš€ Terraform Apply step of the Deploy auth_corp (terraform) job fails during the plan:

Error: No group found matching specified filter (displayName eq 'bus-role.customer support portal users' and securityEnabled eq true)

  with module.application_permissions.data.azuread_group.role_assignments["bus-role.customer support portal users"],
  on .terraform/modules/application_permissions/main.tf line 55, in data "azuread_group" "role_assignments":
  55:   display_name     = each.key

The group name is the business role name in lowercase with a prefix that depends on the environment:

Environment Group name
prod bus-role.<business role>
Every other environment bus-role-np.<business role>

A business role that works in Test, QA, and UAT but fails in production usually has only its bus-role-np. group.


๐Ÿ“Œ Applies to

APIs that map business roles to app roles through the Forge application-permissions module, meaning infra/auth/corp/config.yml has a business_roles list.

Do not use this fix if the group exists with the expected name. Check the spelling of the business role in infra/auth/corp/config.yml against the business roles repository, because a misspelled name produces the same error.

Prerequisites and safety

  • Read access to Entra ID groups through the saif CLI, or through the Azure CLI after az login.
  • Permission to change and deploy your project's corporate business roles repository. See Business Roles for how to find it.
  • The failed apply did not change anything in Entra for the auth_corp deployment, because the error happens during the plan.

โœ… Fix

  1. Confirm which group is missing. Search for the business role with the group name from the error:

    saif business-role search "bus-role.<business role>"
    

    The command strips the bus-role. or bus-role-np. prefix and shows whether a group with that name exists in each environment. A role with only its non-production group shows โœ— under Prod. The command reads group names with the least-privilege Group.ReadBasic.All permission, which hides whether a group is security-enabled, so it cannot tell a security group from a non-security group that has the same name. The module's lookup accepts only security groups.

    โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
    โ”‚ Name                          โ”‚ Non Prod โ”‚ Prod โ”‚
    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ค
    โ”‚ customer support portal users โ”‚ โœ“        โ”‚ โœ—    โ”‚
    โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
    1 business role
    

    If your saif CLI has no business-role command (update the SAIF CLI to get it), or the command reports that Microsoft Graph denied the group lookup, check each group with the Azure CLI instead:

    az ad group list --display-name 'bus-role.<business role>' --query "[].{name:displayName, security:securityEnabled}" -o table
    az ad group list --display-name 'bus-role-np.<business role>' --query "[].{name:displayName, security:securityEnabled}" -o table
    

    --display-name matches names that start with the value, so check for an exact match in the output.

  2. If the business role does not exist in the business roles repository, add it there. See Business Roles.

  3. Run the business roles pipeline and deploy it to the environment from the error. For a production failure, that means the production stage.
  4. Re-run the failed stage of the API pipeline. Only re-run the stage if the run was queued recently. A run queued before a pipeline-templates change keeps the old templates. See Terraform Init fails with 401 Unauthorized from tf.pulumi.com.

๐Ÿ”ฌ Verify

saif business-role search shows โœ“ under the environment from the error. If the deployment still fails with the same error after a โœ“, check that the group is a security group. With the Azure CLI, the az ad group list command for the name in the error returns an exact name match with security set to True.

The re-run Deploy auth_corp (terraform) job completes, and the plan refreshes data.azuread_group.role_assignments["<group name>"] without an error.


๐Ÿง  Cause

The application-permissions module turns each business role in business_roles into a group name, bus-role.<role> in production and bus-role-np.<role> elsewhere, and looks it up with a data "azuread_group" lookup filtered to security groups. The business roles repository creates those groups through its own pipeline, separately from the API. A data source must find the object it asks for, so Terraform stops the plan when the group for that environment does not exist yet.