|
28 | 28 | cf_postgres_check_resource_availability_with_location, \ |
29 | 29 | cf_postgres_flexible_private_dns_zone_suffix_operations, \ |
30 | 30 | cf_postgres_flexible_private_endpoint_connections, \ |
31 | | - cf_postgres_flexible_tuning_options |
| 31 | + cf_postgres_flexible_tuning_options, cf_postgres_flexible_config |
32 | 32 | from ._flexible_server_util import generate_missing_parameters, resolve_poller, \ |
33 | 33 | generate_password, parse_maintenance_window, get_current_time, build_identity_and_data_encryption, \ |
34 | 34 | _is_resource_name, get_tenant_id, get_case_insensitive_key_value, get_enum_value_true_false |
@@ -942,9 +942,14 @@ def flexible_server_identity_update(cmd, client, resource_group_name, server_nam |
942 | 942 | # if user-assigned identity is enabled, then enable both system-assigned and user-assigned identity |
943 | 943 | identity_type = 'SystemAssigned,UserAssigned' |
944 | 944 | else: |
| 945 | + # check if fabric is enabled |
| 946 | + config_client = cf_postgres_flexible_config(cmd.cli_ctx, '_') |
| 947 | + fabric_mirror_status = config_client.get(resource_group_name, server_name, 'azure.fabric_mirror_enabled') |
| 948 | + if (fabric_mirror_status and fabric_mirror_status.value.lower() == 'on'): |
| 949 | + raise CLIError("On servers for which Fabric mirroring is enabled, system assigned managed identity cannot be disabled.") |
945 | 950 | if server.data_encryption.type == 'AzureKeyVault': |
946 | 951 | # if data encryption is enabled, then system-assigned identity cannot be disabled |
947 | | - raise CLIError("Disabling system-assigned identity isn't supported on servers configured to use customer managed keys for data encryption.") |
| 952 | + raise CLIError("On servers for which data encryption is based on customer managed key, system assigned managed identity cannot be disabled.") |
948 | 953 | if identity_type == 'SystemAssigned,UserAssigned': |
949 | 954 | # if both system-assigned and user-assigned identity is enabled, then disable system-assigned identity |
950 | 955 | identity_type = 'UserAssigned' |
|
0 commit comments