Skip to content

Comments

{POSTGRESQL} Update Python SDK for PostgreSQL flexible servers to version API to 2026-01-01-preview#32819

Open
nasc17 wants to merge 6 commits intoAzure:devfrom
nasc17:nasc/sdkUpdate
Open

{POSTGRESQL} Update Python SDK for PostgreSQL flexible servers to version API to 2026-01-01-preview#32819
nasc17 wants to merge 6 commits intoAzure:devfrom
nasc17:nasc/sdkUpdate

Conversation

@nasc17
Copy link
Member

@nasc17 nasc17 commented Feb 20, 2026

Related command
`az postgres flexible-server migrate-network'

Description
Update to new Pythong SDK carrying 2026-01-01-preview
Add new announcements for breaking changes planned to get in May 2026
Introduce Migrate Network command

Testing Guide
Manual

History Notes
[POSTGRESQL] az postgres flexible-server migrate-network: Add new command


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

Copilot AI review requested due to automatic review settings February 20, 2026 03:50
@nasc17 nasc17 requested a review from calvinhzy as a code owner February 20, 2026 03:50
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Feb 20, 2026

️✔️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
️✔️postgresql
️✔️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

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

Hi @nasc17,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 20, 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

azure-client-tools-bot-prd bot commented Feb 20, 2026

⚠️AzureCLI-BreakingChangeTest
⚠️postgresql
rule cmd_name rule_message suggest_message
⚠️ 1003 - CmdPropAdd postgres flexible-server backup create cmd postgres flexible-server backup create added property deprecate_info_target
⚠️ 1001 - CmdAdd postgres flexible-server migrate-network cmd postgres flexible-server migrate-network added

@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 Feb 20, 2026

@yonzhan @yonzhan Please trigger checks, thank you

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

Updates the Azure CLI PostgreSQL flexible server command module to use the newer azure-mgmt-postgresqlflexibleservers SDK (targeting 2026-01-01-preview), adjusts request payloads to match the updated SDK surface, and introduces a new az postgres flexible-server migrate-network command along with accompanying test/recording updates.

Changes:

  • Bump azure-mgmt-postgresqlflexibleservers dependency to 3.0.0b1 (plus platform pins).
  • Update several command implementations to send properties-wrapped request payloads and use server-scoped capability discovery.
  • Add postgres flexible-server migrate-network command, help text, and update scenario tests/recordings for migration flows.

Reviewed changes

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

Show a summary per file
File Description
src/azure-cli/setup.py Updates CLI dependency to azure-mgmt-postgresqlflexibleservers==3.0.0b1.
src/azure-cli/requirements.py3.windows.txt Pins the updated PostgreSQL flexible server SDK for Windows builds.
src/azure-cli/requirements.py3.Linux.txt Pins the updated PostgreSQL flexible server SDK for Linux builds.
src/azure-cli/requirements.py3.Darwin.txt Pins the updated PostgreSQL flexible server SDK for macOS builds.
src/azure-cli/azure/cli/command_modules/postgresql/flexible_server_custom_postgres.py Adapts several operations to updated request shapes; adds flexible_server_migrate_network.
src/azure-cli/azure/cli/command_modules/postgresql/flexible_server_custom_common.py Updates firewall-rule create payload shape; adjusts firewall-rule setter and upgrade payload shape.
src/azure-cli/azure/cli/command_modules/postgresql/flexible_server_commands.py Registers new postgres flexible-server migrate-network command.
src/azure-cli/azure/cli/command_modules/postgresql/_help.py Adds help entry for postgres flexible-server migrate-network.
src/azure-cli/azure/cli/command_modules/postgresql/_breaking_change.py Adds breaking-change announcements related to upgrade and backup behavior.
src/azure-cli/azure/cli/command_modules/postgresql/_transformers.py Makes transform_backup resilient to delattr failures.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_vnet.py Adds a migrate-network scenario step; includes a commented-out test block.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_upgrade.py Updates expected upgrade target version in the test.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_replica.py Adds a replica list test assertion.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_migration.py Uses deterministic migration names for playback/recording consistency.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_identity_microsoft_entra_admin.py Refactors test to create servers explicitly instead of using ServerPreparer.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_identity_cmk.py Reworks checks around CMK identity/encryption validation.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/recordings/test_postgres_flexible_server_onpremise_migration.yaml Updates recordings for new api-version and request/response shapes.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/recordings/test_postgres_flexible_server_migration.yaml Updates recordings for new api-version and request/response shapes.
Comments suppressed due to low confidence (1)

src/azure-cli/azure/cli/command_modules/postgresql/flexible_server_custom_common.py:143

  • flexible_firewall_rule_custom_setter now assumes parameters is a dict and calls .get(...), but this setter is used by generic_update_command with setter_arg_name='parameters' and the corresponding getter returns an SDK model (not a dict). This will raise at runtime when running az postgres flexible-server firewall-rule update. Consider accepting the model instance and constructing the request payload from its attributes (or make getter/custom_func return a dict consistently), and keep local variable names snake_case to avoid lint issues.
def flexible_firewall_rule_custom_setter(client, resource_group_name, server_name, firewall_rule_name, parameters):
    validate_resource_group(resource_group_name)

    endIpAddress = parameters.get('properties', {}).get('endIpAddress')
    startIpAddress = parameters.get('properties', {}).get('startIpAddress')
    parameters = {"properties": {"endIpAddress": endIpAddress, "startIpAddress": startIpAddress}}

    return client.begin_create_or_update(
        resource_group_name,
        server_name,
        firewall_rule_name,
        parameters)

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

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 20, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@nasc17
Copy link
Member Author

nasc17 commented Feb 20, 2026

@yonzhan @calvinhzy Please merge, we are aiming for March release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants