Skip to content

[POSTGRESQL] BREAKING CHANGE: az postgres flexible-server backup | db | firewall-rule | long-term-retention | migration | replica create: Make consistent use of --name and --server-name across all commands#33343

Open
nachoalonsoportillo wants to merge 5 commits intoAzure:devfrom
nachoalonsoportillo:implement-name-to-server-name-breaking-change

Conversation

@nachoalonsoportillo
Copy link
Copy Markdown
Member

@nachoalonsoportillo nachoalonsoportillo commented May 10, 2026

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
Changes implemented:
--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 were correctly using this pattern:
az postgres flexible-server ad-admin
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 weren't using that pattern and are changed with this PR, following corresponding deprecation announcement (#32560):
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


This checklist is used to make sure that common guidelines for a pull request are followed.

- Updated backup commands to use `-s` instead of `-n` for server name in backup management tests.
- Changed database commands to use `-n` for database name instead of `-d` in database management tests.
- Adjusted firewall rule commands to use `--server-name` instead of `-n` for server name in firewall rule management tests.
- Modified long-term retention commands to use `-s` for server name instead of `-n` in LTR management tests.
- Corrected migration commands to use `--server-name` instead of `--name` for server name in migration management tests.
- Updated tag management tests to use `-s` for server name instead of `-n` in backup list command.
Copilot AI review requested due to automatic review settings May 10, 2026 17:31
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Azure CLI Full Test Starting...

Thanks for your contribution!

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 10, 2026

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

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

@github-actions
Copy link
Copy Markdown

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>

Copy link
Copy Markdown
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 implements a breaking CLI argument naming alignment for az postgres flexible-server subcommands so that --name consistently refers to the child resource being acted on (backup/db/firewall rule/migration/etc.), while --server-name is used when the server is an input (not the primary target).

Changes:

  • Updated argument wiring in postgresql/_params.py to swap/redefine --name vs --server-name for backup/db/firewall-rule/long-term-retention/migration command groups.
  • Updated help examples and scenario tests to use the new flags (--server-name/-s and --name/-n) consistently.
  • Adjusted a couple of user-facing messages (replica create missing-arg error; database delete usage text).

Reviewed changes

Copilot reviewed 13 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/azure-cli/azure/cli/command_modules/postgresql/_params.py Re-maps argument option names to enforce --name (child) vs --server-name (server input) across affected command groups.
src/azure-cli/azure/cli/command_modules/postgresql/_help.py Updates command examples to reflect the new argument names.
src/azure-cli/azure/cli/command_modules/postgresql/_breaking_change.py Removes now-obsolete breaking-change announcements for the argument renames (keeps other unrelated notices).
src/azure-cli/azure/cli/command_modules/postgresql/commands/database_commands.py Updates delete error text to reference the new name concept.
src/azure-cli/azure/cli/command_modules/postgresql/commands/replica_commands.py Improves missing-argument error message when neither --name nor --replica-name is provided.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_backup.py Switches backup tests to -s/--server-name + -n/--name pattern.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_db.py Switches db tests to --name for database and --server-name for server.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_elastic_clusters.py Updates db create invocation to the new --name database argument.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_fabric_mirroring.py Updates db create invocation to the new --name database argument.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_firewall_rule.py Switches firewall-rule tests to --server-name for server and --name for rule.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_ltr.py Switches long-term-retention tests to --server-name for server and --name for backup.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_migration.py Switches migration tests to --server-name for server and --name for migration identifier.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_tags.py Updates backup list invocation used for restore-with-tags precondition.

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

Comment thread src/azure-cli/azure/cli/command_modules/postgresql/commands/database_commands.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/postgresql/_params.py
…lica create` to remove `--replica-name` argument and make `--name` required.
- Changed AllowLargeResponse to accept a size parameter of 2048.
- Removed the live_only decorator from the test_postgres_flexible_server_ltr method.
@nachoalonsoportillo
Copy link
Copy Markdown
Member Author

nachoalonsoportillo commented May 10, 2026

Fixes #33333

@nachoalonsoportillo nachoalonsoportillo changed the title [POSTGRESQL] BREAKING CHANGE: az postgres flexible-server backup | db | firewall-rule | long-term-retention | migration | replica create: Make consistent use of --name and --server-name across all commands [PostgreSQL] BREAKING CHANGE: az postgres flexible-server backup | db | firewall-rule | long-term-retention | migration | replica create: Make consistent use of --name and --server-name across all commands May 10, 2026
@nachoalonsoportillo nachoalonsoportillo changed the title [PostgreSQL] BREAKING CHANGE: az postgres flexible-server backup | db | firewall-rule | long-term-retention | migration | replica create: Make consistent use of --name and --server-name across all commands [POSTGRESQL] BREAKING CHANGE: az postgres flexible-server backup | db | firewall-rule | long-term-retention | migration | replica create: Make consistent use of --name and --server-name across all commands May 10, 2026
@yonzhan yonzhan assigned calvinhzy and unassigned zhoxing-ms May 10, 2026
@yonzhan yonzhan removed the Backup label May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants