Skip to content

{POSTGRESQL}az postgres flexible-server createaz postgres flexible-server upgradeaz postgres flexible-server migrate-network: Update help and warning text for migrate network and unsupported version#32958

Open
nasc17 wants to merge 15 commits intoAzure:devfrom
nasc17:nasc/updateUserTest310

Conversation

@nasc17
Copy link
Member

@nasc17 nasc17 commented Mar 11, 2026

Related command
az postgres flexible-server create
az postgres flexible-server upgrade
az postgres flexible-server migrate-network

Description
change the description for the CLI migrate-network command to this: "Migrates an Azure Database for PostgreSQL server from VNet integration to a Private Link network model".
This is important because migration functionality supports only one-way migration (from VNet to PE capable).

Customers using PG version 11, 12 or 13 are informed about extended support.

Testing Guide
Version
az postgres flexible-server create -g nascrunner26 -n nasc-pg13 --version 13
Checking the existence of the resource group 'nascrunner26'...
Resource group 'nascrunner26' exists ? : True
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. Upgrade to PostgreSQL 14 or later as soon as possible to maintain security, performance, and supportability.
Detected current client IP :

Migrate network
Examples
Migrates an Azure Database for PostgreSQL server from VNet integration to a Private Link network
model.
az postgres flexible-server migrate-network --resource-group testGroup --name testserver

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


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

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

Validation for Azure CLI Full Test Starting...

Thanks for your contribution!

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

Validation for Breaking Change Starting...

Thanks for your contribution!

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 11, 2026

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

@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 nasc17 marked this pull request as ready for review March 12, 2026 15:23
@nasc17 nasc17 requested a review from calvinhzy as a code owner March 12, 2026 15:23
Copilot AI review requested due to automatic review settings March 12, 2026 15:23
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 centralizes PostgreSQL version validation/warnings by promoting the existing internal version validator to a reusable pg_version_validator, then reuses it in the flexible server major-version upgrade flow. It also refreshes the help text for the migrate-network command.

Changes:

  • Renames and updates the PostgreSQL version validator to emit a consolidated “retired community version / extended support” warning for versions 11–13.
  • Reuses the version validator in the flexible-server version upgrade command.
  • Updates migrate-network help text to a more specific description.

Reviewed changes

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

File Description
src/azure-cli/azure/cli/command_modules/postgresql/utils/validators.py Renames version validator and updates warning messaging for retired PostgreSQL versions.
src/azure-cli/azure/cli/command_modules/postgresql/commands/upgrade_commands.py Calls shared version validator during major-version upgrades (and updates imports).
src/azure-cli/azure/cli/command_modules/postgresql/_help.py Updates the migrate-network command short-summary and example text.
Comments suppressed due to low confidence (1)

src/azure-cli/azure/cli/command_modules/postgresql/commands/upgrade_commands.py:42

  • pg_version_validator() now raises when version is not in eligible_versions, so the subsequent if version not in eligible_versions: block becomes unreachable for normal non-empty version values and duplicates the validation. This also changes the user-facing error path away from the more specific upgrade error message below. Consider either (a) calling pg_version_validator only for the EOL/retired-version warning (after the upgrade-specific validation), or (b) removing the redundant if version not in eligible_versions: logic and keeping a single consistent error message.
    pg_version_validator(version, eligible_versions)

    if version not in eligible_versions:
        # version not supported
        error_message = ""

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 11 to 15
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
from ..utils.validators import pg_version_validator, validate_citus_cluster, validate_resource_group

logger = get_logger(__name__)
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

After replacing the inline warning with pg_version_validator, this module no longer uses logger (or get_logger). Consider removing the get_logger import and logger = get_logger(__name__) assignment to avoid unused-variable/lint issues.

Copilot uses AI. Check for mistakes.
Comment on lines +363 to 366
short-summary: Migrates 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: Migrates 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
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The help text uses third-person "Migrates" in short-summary and the example name. Elsewhere in this file, short-summary strings are consistently written in imperative form (e.g., "Restart a flexible server."). Consider changing these back to "Migrate ..." for consistency.

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.

5 participants