diff --git a/src/azure-cli/azure/cli/command_modules/postgresql/_help.py b/src/azure-cli/azure/cli/command_modules/postgresql/_help.py index 8d19d312d83..b1e475004b9 100644 --- a/src/azure-cli/azure/cli/command_modules/postgresql/_help.py +++ b/src/azure-cli/azure/cli/command_modules/postgresql/_help.py @@ -360,9 +360,9 @@ helps['postgres flexible-server migrate-network'] = """ type: command -short-summary: Migrate the network mode of a flexible server. +short-summary: Migrate an Azure Database for PostgreSQL server from VNet integration to a Private Link network model. examples: - - name: Migrate the network mode of a flexible server. + - name: Migrate an Azure Database for PostgreSQL server from VNet integration to a Private Link network model. text: az postgres flexible-server migrate-network --resource-group testGroup --name testserver """ diff --git a/src/azure-cli/azure/cli/command_modules/postgresql/commands/upgrade_commands.py b/src/azure-cli/azure/cli/command_modules/postgresql/commands/upgrade_commands.py index ddb5cde6e30..41a05cdab93 100644 --- a/src/azure-cli/azure/cli/command_modules/postgresql/commands/upgrade_commands.py +++ b/src/azure-cli/azure/cli/command_modules/postgresql/commands/upgrade_commands.py @@ -5,15 +5,11 @@ # pylint: disable=unused-argument, line-too-long from azure.cli.core.util import user_confirmation -from knack.log import get_logger from knack.util import CLIError from .._client_factory import cf_postgres_flexible_replica from ..utils._flexible_server_location_capabilities_util import get_postgres_server_capability_info from ..utils._flexible_server_util import resolve_poller -from ..utils.validators import validate_citus_cluster, validate_resource_group - -logger = get_logger(__name__) -# pylint: disable=raise-missing-from +from ..utils.validators import pg_version_validator, validate_citus_cluster, validate_resource_group def flexible_server_version_upgrade(cmd, client, resource_group_name, server_name, version, yes=None): @@ -35,10 +31,7 @@ def flexible_server_version_upgrade(cmd, client, resource_group_name, server_nam list_server_capability_info = get_postgres_server_capability_info(cmd, resource_group_name, server_name) eligible_versions = list_server_capability_info['supported_server_versions'][str(current_version)] - if version == '13': - logger.warning("PostgreSQL version 13 will reach end-of-life (EOL) soon. " - "Upgrade to PostgreSQL 14 or later as soon as possible to " - "maintain security, performance, and supportability.") + pg_version_validator(version, eligible_versions) if version not in eligible_versions: # version not supported 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 a575f666916..8b904c1a551 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 @@ -197,7 +197,7 @@ def pg_arguments_validator(db_context, location, tier, sku_name, storage_gb, ser _pg_sku_name_validator(sku_name, sku_info, tier, instance) _pg_high_availability_validator(high_availability, zonal_resiliency, allow_same_zone, standby_availability_zone, zone, tier, single_az, instance) - _pg_version_validator(version, list_location_capability_info['server_versions']) + pg_version_validator(version, list_location_capability_info['server_versions']) pg_byok_validator(byok_identity, byok_key, backup_byok_identity, backup_byok_key, geo_redundant_backup, instance) is_microsoft_entra_auth = bool(microsoft_entra_auth is not None and microsoft_entra_auth.lower() == 'enabled') _pg_authentication_validator(password_auth, is_microsoft_entra_auth, @@ -342,16 +342,14 @@ def _pg_storage_performance_tier_validator(performance_tier, sku_info, tier=None ' Allowed values : {}'.format(storage_size, performance_tiers)) -def _pg_version_validator(version, versions): +def pg_version_validator(version, versions): if version: if version not in versions: raise CLIError('Incorrect value for --version. Allowed values : {}'.format(sorted(versions))) - if version in ('11', '12'): - logger.warning("Support for PostgreSQL %s has officially ended. " - "We recommend selecting PostgreSQL 14 or a later version for " - "all future operations.", str(version)) - if version == '13': - logger.warning("PostgreSQL version 13 will reach end-of-life (EOL) soon. " + if version in ('11', '12', '13'): + logger.warning("The version selected is a retired community version of PostgreSQL. " + "To use this version, you will automatically be enrolled in our extended " + "support plan for an additional charge starting August 1, 2026. " "Upgrade to PostgreSQL 14 or later as soon as possible to " "maintain security, performance, and supportability.")