diff --git a/internal/services/groups/group_resource.go b/internal/services/groups/group_resource.go index 4153f8aaa..4470e382b 100644 --- a/internal/services/groups/group_resource.go +++ b/internal/services/groups/group_resource.go @@ -681,7 +681,7 @@ func groupResourceCreate(ctx context.Context, d *pluginsdk.ResourceData, meta in } // No point in retrying if the caller wasn't specified as an owner - if len(ownersWithoutCallingPrincipal) == len(*properties.Owners) { + if len(ownersWithoutCallingPrincipal) == len(pointer.From(properties.Owners)) { log.Printf("[DEBUG] Not retrying group creation for %q as owner was not specified", displayName) return tf.ErrorDiagF(err, "Creating group %q", displayName) } @@ -1095,7 +1095,7 @@ func groupResourceUpdate(ctx context.Context, d *pluginsdk.ResourceData, meta in } existingMembers := make([]string, 0) - for resp.Model != nil { + if resp.Model != nil { for _, m := range *resp.Model { existingMembers = append(existingMembers, pointer.From(m.DirectoryObject().Id)) } @@ -1137,7 +1137,7 @@ func groupResourceUpdate(ctx context.Context, d *pluginsdk.ResourceData, meta in } existingOwners := make([]string, 0) - for resp.Model != nil { + if resp.Model != nil { for _, o := range *resp.Model { existingOwners = append(existingOwners, pointer.From(o.DirectoryObject().Id)) } diff --git a/internal/services/groups/group_resource_test.go b/internal/services/groups/group_resource_test.go index fe02ff8a9..b1ec12f17 100644 --- a/internal/services/groups/group_resource_test.go +++ b/internal/services/groups/group_resource_test.go @@ -844,7 +844,7 @@ resource "azuread_application" "test" { } resource "azuread_service_principal" "test" { - application_id = azuread_application.test.application_id + client_id = azuread_application.test.client_id } resource "azuread_group" "test" { @@ -917,7 +917,7 @@ resource "azuread_application" "test" { } resource "azuread_service_principal" "test" { - application_id = azuread_application.test.application_id + client_id = azuread_application.test.client_id } resource "azuread_group" "test" { @@ -1020,8 +1020,8 @@ resource "azuread_application" "test" { } resource "azuread_service_principal" "test" { - count = 27 - application_id = azuread_application.test[count.index].application_id + count = 27 + client_id = azuread_application.test[count.index].client_id } resource "azuread_user" "test" {