Closed Tolbin10088 closed 1 week ago
Hi @Tolbin10088,
I am facing the same issue and have tried several things to fix the problem or find a workaround...
1) If you replace the following block:
resource "azuredevops_group" "ado_group_linked_to_ad_group1" {
origin_id = data.azuread_group.ad_group_info.object_id
}
with an azuredevops_group
data block, sometimes Terraform is able to find the group, and sometimes it can't, which is weird. Maybe it works if the group has been manually added to another project in the organization but I am not convinced by this workaround.
2) I also tried to create all of my ado_group_linked_to_ad_group
in a specific repo/tfstate, and I still face many issues as they are not related to a project id (it can only add a few of them, sees drifts all the time, etc.).
3) An ugly workaround would be to create a new Azure AAD group dedicated to a specific project and use it then in Azure DevOps..
I guess the only way to fix the problem is to handle the scope parameter with the origin_id parameter ?
Have you found any other workarounds?
Thanks guys
Hello everyone, The only workaround I found so far is to create in AAD a project specific group. And add nested groups and members in it.
@Tolbin10088 The AAD group was create at ORG level so you don't need to create them for every project as they are the same resource in ADO. You just need to create AAD group once in ADO.
resource "azuredevops_group" "ado_group_linked_to_ad_group2"
and resource "azuredevops_group" "ado_group_linked_to_ad_group1" {
are same resource.
Community Note
Terraform (and Azure DevOps Provider) Version
Affected Resource(s)
azuredevops_group
Terraform Configuration Files
Phase 1:
Phase 2:
Debug Output
Panic Output
Expected Behavior
During Phase 1:
During Phase 2:
Actual Behavior
During Phase 1:
During Phase 2:
This is due to a limitation in the current TF provider as its not posssible to set a 'scope' within the azuredevops_group when using the 'originid' key. This key is required when using external groups e.g. AAD groups
Steps to Reproduce
Phase 1:
terraform apply
using the Terraform Code Shared abovePhase 2:
terraform apply
Important Factoids
AAD Group created outside of this TF code and used via Azure AD Data call
From my own investigation along with @a30000931 the issue appears to be due to a limitation in the provider that prevents you from using both the 'orginid' field required when using an external group e.g. AAD and the 'scope' field which can be used when using ADO groups.
This behaviour is different from when carrying out the same tasks via the GUI. When using the GUI the ADD group remains a member of the project 2 ADO group when project 1 is destroyed
References
417
51
0000