Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,45 @@
from azure.cli.core.breaking_change import (register_argument_deprecate, register_command_group_deprecate,
register_other_breaking_change)

NETWORK_RESOURCE_BREAKING_CHANGE_MESSAGE = (
'The --address-prefixes and --subnet-prefixes arguments have been deprecated and will be removed. '
'This command will stop creating new network resources or altering existing ones which are required '
'for the server to function, such as virtual networks, subnets, IP ranges, etc. It will instead '
'require users to provide the necessary network resources created beforehand using the corresponding '
'commands from the `az network` module. This change will take effect in next breaking change '
'release scheduled for May 2026.'
)


def _register_network_resource_breaking_change(command_name):
register_other_breaking_change(command_name, message=NETWORK_RESOURCE_BREAKING_CHANGE_MESSAGE)


# These commands will stop creating or altering required network resources and will instead require
# users to provide those resources up front using the corresponding `az network` commands.
# Parameters --address-prefixes and --subnet-prefixes will also be deprecated for these commands as part of this change.
for network_command in (
'postgres flexible-server create',
'postgres flexible-server replica create',
'postgres flexible-server restore',
'postgres flexible-server geo-restore',
'postgres flexible-server revive-dropped'):
_register_network_resource_breaking_change(network_command)


# High availability command argument changes
register_argument_deprecate('postgres flexible-server create', '--high-availability', redirect='--zonal-resiliency')
register_argument_deprecate('postgres flexible-server update', '--high-availability', redirect='--zonal-resiliency')

# Index Tuning command argument changes
# Index Tuning command group renamed to Autonomous Tuning as the feature has expanded to
# include more types of recommendations beyond just index tuning
register_command_group_deprecate(command_group='postgres flexible-server index-tuning',
redirect='postgres flexible-server autonomous-tuning',
message='Index tuning feature has now expanded its capabilities to support '
'other automatically generated recommendations which are covered by the '
'new command.')

# Long term retention command argument changes
# Long term retention command group deprecated with no redirect as the functionality will be removed in the future
register_command_group_deprecate(command_group='postgres flexible-server long-term-retention',
message='Long term retention command group will be removed. '
'For more information, open a support incident.')
Expand Down
Loading