Skip to content

Commit

Permalink
{RDBMS} az postgres flexible-server identity_remove: Add a check to d…
Browse files Browse the repository at this point in the history
…etermine whether the user identity is used for geo backup data encryption (#30588)

Co-authored-by: Matthew Boentoro <[email protected]>
  • Loading branch information
mattboentoro and Matthew Boentoro authored Jan 3, 2025
1 parent 024cfb6 commit f499bfa
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,11 @@ def flexible_server_identity_remove(cmd, client, resource_group_name, server_nam
if primary_id and primary_id.lower() in [identity.lower() for identity in identities]:
raise CLIError("Cannot remove identity {} because it's used for data encryption.".format(primary_id))

geo_backup_id = instance.data_encryption.geo_backup_user_assigned_identity_id

if geo_backup_id and geo_backup_id.lower() in [identity.lower() for identity in identities]:
raise CLIError("Cannot remove identity {} because it's used for geo backup data encryption.".format(geo_backup_id))

identities_map = {}
for identity in identities:
identities_map[identity] = None
Expand Down

0 comments on commit f499bfa

Please sign in to comment.