Open J3d3r opened 7 months ago
We get the same problem trying to remove a group member, even though the user performing the operation in a group owner. We are using Pulumi, but that uses the Terraform AD provider under the hood
Having the same issue with tf 1.9.8 and azuread 3.0.2, are you still seeing the problem / any fix?
Community Note
Terraform (and AzureAD Provider) Version
Terraform v1.3.10 on windows_amd64
Affected Resource(s)
Terraform Configuration Files
Debug Output
Issue is easy to reproduce. Nothing interesting to see in the logs. I will only paste small output here...
azuread_group_member.group_member: Destroying... [id=/member/]
â•·
│ Error: Waiting for removal of member "" from group with object ID ""
│
│ retrieving resource: GroupsClient.BaseClient.Get(): unexpected status 403 with OData error: Authorization_RequestDenied: Insufficient privileges to complete the operation.
╵
Error occurred while executing scripts!
Press any key to continue . . .
Expected Behavior
When the "azuread_group_member" resource is being removed from the configuration the actual group member should be removed from the group without throwing any errors.
Actual Behavior
Terraform is throwing an error (see above) about "Insufficient privileges...". The group member is still being removed which indicates that the permissions are right but Terraform is somehow misbehaving.
Steps to Reproduce
terraform apply
Important Factoids
Please note that according to the Terraform docs no additional API permission should be required for using "azuread_group_member" if the service principal used for deployment is being an owner of the group in question (https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/group_member#api-permissions). This is at least not correct if the members that should be added to the group are managed identities. In this case "Application.Read.All" API permission is required.
References
Similar issue but with adding group members. Perhaps "Application.Read.All" API permission is missing here... https://github.com/hashicorp/terraform-provider-azuread/issues/1202https://github.com/hashicorp/terraform-provider-azuread/issues/1202
0000