From 4c4c0a3de26fc41d4ee645d8435397933397219a Mon Sep 17 00:00:00 2001 From: Matthew Boentoro Date: Wed, 1 Apr 2026 14:37:48 -0700 Subject: [PATCH] [POSTGRESQL] `az postgres flexible-server create`: Block SSDv2 creation for PG version < 14 --- .../cli/command_modules/postgresql/utils/validators.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/postgresql/utils/validators.py b/src/azure-cli/azure/cli/command_modules/postgresql/utils/validators.py index 8b904c1a551..d0e618db0bf 100644 --- a/src/azure-cli/azure/cli/command_modules/postgresql/utils/validators.py +++ b/src/azure-cli/azure/cli/command_modules/postgresql/utils/validators.py @@ -185,7 +185,7 @@ def pg_arguments_validator(db_context, location, tier, sku_name, storage_gb, ser else: supported_storageV2_size = None _pg_storage_type_validator(storage_type, auto_grow, performance_tier, - tier, supported_storageV2_size, iops, throughput, instance) + tier, supported_storageV2_size, iops, throughput, instance, version) _pg_storage_performance_tier_validator(performance_tier, sku_info, tier, @@ -712,11 +712,13 @@ def validate_identities(cmd, namespace): def _pg_storage_type_validator(storage_type, auto_grow, performance_tier, tier, - supported_storageV2_size, iops, throughput, instance): + supported_storageV2_size, iops, throughput, instance, version): is_create_ssdv2 = storage_type == "PremiumV2_LRS" is_update_ssdv2 = instance is not None and instance.storage.type == "PremiumV2_LRS" if is_create_ssdv2: + if version and int(version) < 14: + raise CLIError('Storage type PremiumV2_LRS is only supported for PostgreSQL version 14 and above.') if supported_storageV2_size is None: raise CLIError('Storage type set to PremiumV2_LRS is not supported for this region.') if iops is None or throughput is None: