You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Group is created within the relevant administrative unit
Actual Behavior
When I run this code as a service principal with the Groups Administrator role, I get an error:
Error: �Creating group in administrative unit with ID "[...]", "test-group"�[0m
withazuread_group.group
on aad_groups.tf line 1, in resource "azuread_group" "group":
1: resource "azuread_group" "group" {
AdministrativeUnitsClient.BaseClient.Post(): unexpected status 403 with
OData error: Authorization_RequestDenied: Insufficient privileges to complete the operation.
When I run using a user principal with the same permissions it works fine. Is it supported to run with an SPN using this configuration when the SPN only has priviledges to create groups within the administrative unit?
The text was updated successfully, but these errors were encountered:
Ran into this same issue today. I haven't been in a position to test this yet, but even with the Groups Administrator role assigned in the scope of an AU, the Service Principal may still need broader tenant level reading permissions than just whatever objects that it would be adding as members to the group (User, Application or Group, for instance). This section in their docs seems to imply that it may need something akin to the Directory Readers role. That could be a troubleshooting step to see if these issues resolve for anyone that is running into this.
When creating groups in administrative units, it must be possible to read the administrative units - this can be granted through the AdministrativeUnits.Read.All or Directory.Read.All app roles. I've opened #1594 to document this.
Community Note
Terraform (and AzureAD Provider) Version
Terraform v1.3.9
on windows_amd64
Affected Resource(s)
azuread_group
Terraform Configuration Files
Expected Behavior
Group is created within the relevant administrative unit
Actual Behavior
When I run this code as a service principal with the
Groups Administrator
role, I get an error:Error: �Creating group in administrative unit with ID "[...]", "test-group"�[0m
withazuread_group.group
on aad_groups.tf line 1, in resource "azuread_group" "group":
1: resource "azuread_group" "group" {
AdministrativeUnitsClient.BaseClient.Post(): unexpected status 403 with
OData error: Authorization_RequestDenied: Insufficient privileges to complete the operation.
When I run using a user principal with the same permissions it works fine. Is it supported to run with an SPN using this configuration when the SPN only has priviledges to create groups within the administrative unit?
The text was updated successfully, but these errors were encountered: