Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group ownership breaks when switching from user to service principal #761

Open
brk3 opened this issue Oct 28, 2021 · 0 comments
Open

Group ownership breaks when switching from user to service principal #761

brk3 opened this issue Oct 28, 2021 · 0 comments

Comments

@brk3
Copy link
Contributor

brk3 commented Oct 28, 2021

After initial bootstrap using a user account, we would like to assume the identity of a service principal for subsequent deploys (see also #759).

Currently on the first deploy, any created groups via modules/azuread/groups/ are assigned the current user as the owner. This results in the following issue:

  • Group is created with my user as owner
  • On the second run, the module attempts to remove my user as owner and replace it with the service principal. This is not possible:

It's recommended to always specify one or more group owners, including the principal being used to execute Terraform, such as in the example above. When removing group owners, if a user principal has been assigned ownership, the last user cannot be removed as an owner. Microsoft 365 groups are required to always have at least one owner which must be a user (i.e. not a service principal).

One option seems to be to add extra groups / users as owners on the group. However right now it's not possible to assign owners via our modules/azuread/groups/ module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant