Skip to content

Conversation

@nasc17
Copy link
Member

@nasc17 nasc17 commented Dec 19, 2025

Related command
az postgres flexible-server backup az postgres flexible-server db az postgres flexible-server firewall-rule az postgres flexible-server long-term-retention az postgres flexible-server migration az postgres flexible-server replica create

Description
Wish to change in future:
--name should refer to the object to which the command refers
--server-name should be used whenever the command doesn't refer directly to the server object, but requires the name of the server to be provided as an input.

Commands which are correctly using this pattern:
az postgres flexible-server ad-admin commands.
az postgres flexible-server advanced-threat-protection-setting.
az postgres flexible-server identity.
az postgres flexible-server parameter.
az postgres flexible-server private-endpoint-connection.
az postgres flexible-server private-link-resource.
az postgres flexible-server server-logs.
az postgres flexible-server virtual-endpoint.

Commands which aren't using that pattern and should be changed, following corresponding deprecation path:
az postgres flexible-server backup: --backup-name should be replaced with --name, and --name should be replaced with --server-name.
az postgres flexible-server db: --database-name should be replaced with --name.
az postgres flexible-server firewall-rule: --name should be replaced with --server-name, and --rule-name should be replaced with --name.
az postgres flexible-server long-term-retention: --name should be replaced with --server-name.
az postgres flexible-server migration: --migration-name should be replaced with --name, and --name should be replaced with --server-name.

Testing Guide

History Notes
[RDBMS] az postgres flexible-server replica create: Add --name argument to specify read replica name

Copilot AI review requested due to automatic review settings December 19, 2025 04:17
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Dec 19, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@nasc17 nasc17 review requested due to automatic review settings December 19, 2025 04:17
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Dec 19, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️rdbms
rule cmd_name rule_message suggest_message
⚠️ 1013 - SubgroupPropAdd postgres flexible-server backup sub group postgres flexible-server backup added property deprecate_info_target
⚠️ 1013 - SubgroupPropAdd postgres flexible-server db sub group postgres flexible-server db added property deprecate_info_target
⚠️ 1013 - SubgroupPropAdd postgres flexible-server firewall-rule sub group postgres flexible-server firewall-rule added property deprecate_info_target
⚠️ 1013 - SubgroupPropAdd postgres flexible-server long-term-retention sub group postgres flexible-server long-term-retention added property deprecate_info_target
⚠️ 1013 - SubgroupPropAdd postgres flexible-server migration sub group postgres flexible-server migration added property deprecate_info_target
⚠️ 1006 - ParaAdd postgres flexible-server replica create cmd postgres flexible-server replica create added parameter name
⚠️ 1009 - ParaPropRemove postgres flexible-server replica create cmd postgres flexible-server replica create update parameter replica_name: removed property required=True

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 19, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@nasc17 nasc17 requested a review from mattboentoro December 19, 2025 04:17
@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@nasc17
Copy link
Member Author

nasc17 commented Dec 19, 2025

@evelyn-ys please trigger checks

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 19, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings January 2, 2026 20:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR establishes a consistent argument naming pattern across Azure PostgreSQL flexible-server commands by introducing breaking change announcements and adding the --name argument to the replica create command. The changes deprecate --replica-name in favor of --name to align with the established pattern where --name refers to the object the command operates on, and --server-name is used when the command requires a server reference.

Key changes:

  • Adds breaking change announcements for multiple command groups (backup, db, firewall-rule, long-term-retention, migration, replica)
  • Introduces --name argument as the preferred option for replica create command while maintaining backward compatibility with --replica-name
  • Updates all tests and documentation examples to use the new --name argument

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
_breaking_change.py Adds breaking change announcements for upcoming argument naming standardization across backup, database, firewall-rule, long-term-retention, migration, and replica commands
_params.py Adds --name parameter definition for replica create command alongside existing --replica-name
flexible_server_custom_postgres.py Updates replica create function to accept both --name and --replica-name arguments with fallback logic
_helptext_pg.py Updates all help text examples to use --name instead of --replica-name
test_rdbms_flexible_commands.py Updates 11 test cases to use --name argument instead of --replica-name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +23 to +63
'in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server long-term-retention',
message='The --name/-n argument will be repurposed to specify the backup name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in next breaking change release(2.86.0) scheduled for May 2026.')

# Backup command argument changes
register_other_breaking_change('postgres flexible-server backup',
message='The --backup-name/-b argument has been deprecated and will be removed '
'in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server backup',
message='The --name/-n argument will be repurposed to specify the backup name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in next breaking change release(2.86.0) scheduled for May 2026.')

# Database command argument changes
register_other_breaking_change('postgres flexible-server db',
message='The --database-name/-d argument has been deprecated and will be removed '
'in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server db',
message='The --name/-n argument will be repurposed to specify the database name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in next breaking change release(2.86.0) scheduled for May 2026.')

# Firewall rule command argument changes
register_other_breaking_change('postgres flexible-server firewall-rule',
message='The --name/-n argument will be repurposed to specify the firewall rule '
'name. The --server-name/-s argument will be introduced to specify the server '
'name in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server firewall-rule',
message='The --rule-name/-r argument has been deprecated and will be removed '
'in next breaking change release(2.86.0) scheduled for May 2026.')

# Migration command argument changes
register_other_breaking_change('postgres flexible-server migration',
message='The --migration-name argument has been deprecated and will be removed '
'in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server migration',
message='The --name/-n argument will be repurposed to specify the migration name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in next breaking change release(2.86.0) scheduled for May 2026.')
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The breaking change messages for these command groups use inconsistent phrasing. Some say "will be repurposed" while others say "will be introduced". Additionally, the message says "in next breaking change release(2.86.0) scheduled for May 2026" but should be more consistently formatted as "in the next breaking change release (2.86.0) scheduled for May 2026" (with article "the" and proper spacing around parentheses) to match standard English grammar.

Suggested change
'in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server long-term-retention',
message='The --name/-n argument will be repurposed to specify the backup name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in next breaking change release(2.86.0) scheduled for May 2026.')
# Backup command argument changes
register_other_breaking_change('postgres flexible-server backup',
message='The --backup-name/-b argument has been deprecated and will be removed '
'in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server backup',
message='The --name/-n argument will be repurposed to specify the backup name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in next breaking change release(2.86.0) scheduled for May 2026.')
# Database command argument changes
register_other_breaking_change('postgres flexible-server db',
message='The --database-name/-d argument has been deprecated and will be removed '
'in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server db',
message='The --name/-n argument will be repurposed to specify the database name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in next breaking change release(2.86.0) scheduled for May 2026.')
# Firewall rule command argument changes
register_other_breaking_change('postgres flexible-server firewall-rule',
message='The --name/-n argument will be repurposed to specify the firewall rule '
'name. The --server-name/-s argument will be introduced to specify the server '
'name in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server firewall-rule',
message='The --rule-name/-r argument has been deprecated and will be removed '
'in next breaking change release(2.86.0) scheduled for May 2026.')
# Migration command argument changes
register_other_breaking_change('postgres flexible-server migration',
message='The --migration-name argument has been deprecated and will be removed '
'in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server migration',
message='The --name/-n argument will be repurposed to specify the migration name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in next breaking change release(2.86.0) scheduled for May 2026.')
'in the next breaking change release (2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server long-term-retention',
message='The --name/-n argument will be repurposed to specify the backup name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in the next breaking change release (2.86.0) scheduled for May 2026.')
# Backup command argument changes
register_other_breaking_change('postgres flexible-server backup',
message='The --backup-name/-b argument has been deprecated and will be removed '
'in the next breaking change release (2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server backup',
message='The --name/-n argument will be repurposed to specify the backup name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in the next breaking change release (2.86.0) scheduled for May 2026.')
# Database command argument changes
register_other_breaking_change('postgres flexible-server db',
message='The --database-name/-d argument has been deprecated and will be removed '
'in the next breaking change release (2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server db',
message='The --name/-n argument will be repurposed to specify the database name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in the next breaking change release (2.86.0) scheduled for May 2026.')
# Firewall rule command argument changes
register_other_breaking_change('postgres flexible-server firewall-rule',
message='The --name/-n argument will be repurposed to specify the firewall rule '
'name. The --server-name/-s argument will be introduced to specify the server '
'name in the next breaking change release (2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server firewall-rule',
message='The --rule-name/-r argument has been deprecated and will be removed '
'in the next breaking change release (2.86.0) scheduled for May 2026.')
# Migration command argument changes
register_other_breaking_change('postgres flexible-server migration',
message='The --migration-name argument has been deprecated and will be removed '
'in the next breaking change release (2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server migration',
message='The --name/-n argument will be repurposed to specify the migration name. '
'The --server-name/-s argument will be introduced to specify the server name '
'in the next breaking change release (2.86.0) scheduled for May 2026.')

Copilot uses AI. Check for mistakes.
replica_name = replica_name.lower()

if replica_name is None and name is None:
raise RequiredArgumentMissingError('the following arguments are required: --name')
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message should mention both the new --name and the deprecated --replica-name arguments since both are valid during the transition period. The message currently only mentions --name, which could confuse users who are still using --replica-name. Consider updating to: "One of the following arguments is required: --name, --replica-name"

Suggested change
raise RequiredArgumentMissingError('the following arguments are required: --name')
raise RequiredArgumentMissingError('One of the following arguments is required: --name, --replica-name')

Copilot uses AI. Check for mistakes.
replica_name = replica_name.lower()

if replica_name is None and name is None:
raise RequiredArgumentMissingError('the following arguments are required: --name')
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic for handling --name and --replica-name gives priority to --name when both are provided (line 604: replica_name.lower() if name is None else name.lower()). However, there's no warning or error when both arguments are specified simultaneously. This could lead to confusion during the transition period. Consider adding a check to either warn users or raise a MutuallyExclusiveArgumentError when both arguments are provided, to guide users toward using only --name.

Suggested change
raise RequiredArgumentMissingError('the following arguments are required: --name')
raise RequiredArgumentMissingError('the following arguments are required: --name')
if replica_name is not None and name is not None:
raise MutuallyExclusiveArgumentError('usage error: --name and --replica-name cannot be used together. Please use --name.')

Copilot uses AI. Check for mistakes.
with self.argument_context('{} flexible-server replica create'.format(command_group)) as c:
c.argument('source_server', arg_type=source_server_arg_type)
c.argument('replica_name', options_list=['--replica-name'],
help='The name of the server to restore to.')
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text for the deprecated --replica-name argument is incorrect. It says "The name of the server to restore to." but should say "The name of the read replica." This argument is being deprecated in favor of --name, but its help text should still accurately describe its purpose while it remains available.

Suggested change
help='The name of the server to restore to.')
help='The name of the read replica.')

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants