-
Notifications
You must be signed in to change notification settings - Fork 300
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
Creating Azure AD group without owners #711
Comments
Hi @miqm, thanks for requesting this. Unfortunately, API changes made in the last few months mean we are unable to create groups without owners. We have done our best to document this and other constraints on the documentation page for the azuread_group resource. |
@manicminer - in the docs you say |
@miqm Thanks, that isn't as clear as it could be and we can improve the wording there. Though in the description for the
I'll look at tidying up the info box as I can see how that might be misleading. |
AAD Security Groups can be created without owners or have all owners or members removed. I'm not talking about M365 groups but the security ones. |
There is an API bug which applies the same conditions to security groups. It's inconsistently applied to different users/tenants so in order to support those for whom this bug manifests, we have to enforce group ownership regardless of group type. |
So if it is a bug this means that it will work someday. All CLI and portal uses API to create groups, enforcing owners by TF while rest of the tools doesn't have this problem is odd. Perhaps you could add some switch on provider to wave this limitation for users that are sure it'll work? |
Unfortunately the behavior of the Portal and CLI isn't representative of the experience when using a tool like Terraform, as they are first-party Microsoft apps. We're unlikely to change the provider behavior here until such as time as we can confirm the API is fixed, as the logic around group ownership is complex and balanced right now to avoid breaking users as much as possible. |
Thanks. I saw also your GH issue microsoftgraph/msgraph-metadata#92 and there's a comment
Could TF provider implement such behaviour as an alternative? |
Also if #435 is considered to implement you shouldn't set owners to empty list if property is not provided - just don't provide and the api should not clear it and will allow to create security groups without owners but then we'll need to maintain group owners by using separate resources. |
That comment is prefixed with "If I use the active directory via Azure portal", which as I mentioned isn't a good indicator as the portal is a first-party app. One person's experience doesn't always match another's. When no owners are specified on group creation, sometimes the API obliges, but sometimes it adds an owner automatically, and sometimes it just returns a 400 error - both for security groups and M365 (unified) groups. The constraint on the type of owner for M365 groups is also inconsistently applied, and also erroneously applied to security groups. #435 was opened (and my initial comment there added) prior to the API introducing these breaking changes. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Description
I've seen some discussion on problem with AD v2 and group owners list. I want to maintain AD groups that does not have an owner - just as I would create them on Azure Portal. Additionally, this can be handy when specifying group owners as resources as described in #435
New or Affected Resource(s)
Potential Terraform Configuration
Option 1 - specify that group will be created without owners:
Option 1 - not providing
owners
creates a group without owners:References
The text was updated successfully, but these errors were encountered: