{POSTGRESQL} Update Python SDK for PostgreSQL flexible servers to version API to 2026-01-01-preview#32819
{POSTGRESQL} Update Python SDK for PostgreSQL flexible servers to version API to 2026-01-01-preview#32819
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @nasc17, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| postgres flexible-server backup create | cmd postgres flexible-server backup create added property deprecate_info_target |
||
| postgres flexible-server migrate-network | cmd postgres flexible-server migrate-network added |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
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-postgresqlflexibleserversdependency to3.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-networkcommand, 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_setternow assumesparametersis a dict and calls.get(...), but this setter is used bygeneric_update_commandwithsetter_arg_name='parameters'and the correspondinggetterreturns an SDK model (not a dict). This will raise at runtime when runningaz 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.
...li/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_vnet.py
Show resolved
Hide resolved
.../cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_identity_cmk.py
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@yonzhan @calvinhzy Please merge, we are aiming for March release |
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 commandThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.