Skip to content

Commit 4100478

Browse files
author
Matthew Boentoro
committed
{RDBMS} az postgres flexible-server identity_remove: Add a check to determine whether the user identity is used for geo backup data encryption
1 parent ff7d0fd commit 4100478

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,11 @@ def flexible_server_identity_remove(cmd, client, resource_group_name, server_nam
982982
if primary_id and primary_id.lower() in [identity.lower() for identity in identities]:
983983
raise CLIError("Cannot remove identity {} because it's used for data encryption.".format(primary_id))
984984

985+
geo_backup_id = instance.data_encryption.geo_backup_user_assigned_identity_id
986+
987+
if geo_backup_id and geo_backup_id.lower() in [identity.lower() for identity in identities]:
988+
raise CLIError("Cannot remove identity {} because it's used for geo backup data encryption.".format(geo_backup_id))
989+
985990
identities_map = {}
986991
for identity in identities:
987992
identities_map[identity] = None

0 commit comments

Comments
 (0)