diff --git a/internal/services/identitygovernance/access_package_assignment_policy_resource_test.go b/internal/services/identitygovernance/access_package_assignment_policy_resource_test.go index 8e1ea7c69..021515003 100644 --- a/internal/services/identitygovernance/access_package_assignment_policy_resource_test.go +++ b/internal/services/identitygovernance/access_package_assignment_policy_resource_test.go @@ -76,6 +76,13 @@ func TestAccAccessPackageAssignmentPolicy_update(t *testing.T) { ), }, data.ImportStep(), + { + Config: r.simple(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), { Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( diff --git a/internal/services/identitygovernance/identitygovernance.go b/internal/services/identitygovernance/identitygovernance.go index bd77c36c0..8142de5a6 100644 --- a/internal/services/identitygovernance/identitygovernance.go +++ b/internal/services/identitygovernance/identitygovernance.go @@ -131,6 +131,17 @@ func expandAssignmentReviewSettings(input []interface{}) (*msgraph.AssignmentRev result.Reviewers = expandUserSets(in["reviewer"].([]interface{})) + if result.AccessReviewTimeoutBehavior == "" && + (result.DurationInDays == nil || *result.DurationInDays == 0) && + (result.IsAccessRecommendationEnabled == nil || !*result.IsAccessRecommendationEnabled) && + (result.IsApprovalJustificationRequired == nil || !*result.IsApprovalJustificationRequired) && + (result.IsEnabled == nil || !*result.IsEnabled) && + result.RecurrenceType == "" && + result.ReviewerType == "" && + (result.Reviewers == nil || len(*result.Reviewers) == 0) { + return nil, nil + } + return &result, nil }