diff --git a/internal/services/directoryroles/migrations/directory_role_assignment_resource.go b/internal/services/directoryroles/migrations/directory_role_assignment_resource.go index d8d64ec85..11fd670f6 100644 --- a/internal/services/directoryroles/migrations/directory_role_assignment_resource.go +++ b/internal/services/directoryroles/migrations/directory_role_assignment_resource.go @@ -2,11 +2,9 @@ package migrations import ( "context" - "fmt" "log" "github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/stable" - "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azuread/internal/helpers/tf/pluginsdk" ) @@ -45,10 +43,6 @@ func ResourceDirectoryRoleAssignmentInstanceResourceV0() *pluginsdk.Resource { func ResourceDirectoryRoleAssignmentInstanceStateUpgradeV0(_ context.Context, rawState map[string]interface{}, _ interface{}) (map[string]interface{}, error) { log.Println("[DEBUG] Migrating ID from v0 to v1 format") oldId := rawState["id"].(string) - if _, err := uuid.ParseUUID(oldId); err != nil { - return rawState, fmt.Errorf("parsing ID for `azuread_directory_role_assignment`: %+v", err) - } - newId := stable.NewRoleManagementDirectoryRoleAssignmentID(oldId) rawState["id"] = newId.ID() return rawState, nil diff --git a/internal/services/serviceprincipals/migrations/service_principal_delegated_permission_grant_resource.go b/internal/services/serviceprincipals/migrations/service_principal_delegated_permission_grant_resource.go index 07d78397c..a1efd1eed 100644 --- a/internal/services/serviceprincipals/migrations/service_principal_delegated_permission_grant_resource.go +++ b/internal/services/serviceprincipals/migrations/service_principal_delegated_permission_grant_resource.go @@ -2,11 +2,9 @@ package migrations import ( "context" - "fmt" "log" "github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/stable" - "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azuread/internal/helpers/tf/pluginsdk" ) @@ -46,10 +44,6 @@ func ResourceServicePrincipalDelegatedPermissionGrantInstanceResourceV0() *plugi func ResourceServicePrincipalDelegatedPermissionGrantInstanceStateUpgradeV0(_ context.Context, rawState map[string]interface{}, _ interface{}) (map[string]interface{}, error) { log.Println("[DEBUG] Migrating ID from v0 to v1 format") oldId := rawState["id"].(string) - if _, err := uuid.ParseUUID(oldId); err != nil { - return rawState, fmt.Errorf("parsing ID for `azuread_service_principal_delegated_permission_grant`: %+v", err) - } - newId := stable.NewOAuth2PermissionGrantID(oldId) rawState["id"] = newId.ID() return rawState, nil