-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[RDBMS] az postgres flexible-server update: BUG FIX, correcting use of argument --standby-zone when enabling high availability
#32559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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.
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 fixes a bug in the az postgres flexible-server update command where updating a server to enable high availability with a standby zone was incorrectly failing with an InvalidParameterValue error.
Key Changes:
- Fixed logical operator in high availability validator from OR to AND to properly validate when standby zones can be specified
- Added
availability_zoneparameter to theServerForPatchobject to ensure the primary zone is included when updating HA settings
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/rdbms/validators.py | Corrected validation logic to allow setting standby zone when either high availability mode OR zonal resiliency is enabled (changed from requiring both) |
| src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py | Added availability_zone to ServerForPatch parameters to satisfy API requirements when updating high availability with standby zone |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@evelyn-ys Please trigger checks and review |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@evelyn-ys please merge |
Related command
az postgres flexible-server updateDescription
az cli is returning invalid parameter when there is no invalid parameter.
(InvalidParameterValue) Invalid value given for parameter StandbyAvailabilityZone,availabilityZone. Specify a valid parameter value.
Code: InvalidParameterValue
Message: Invalid value given for parameter StandbyAvailabilityZone,availabilityZone. Specify a valid parameter value.
Testing Guide
'postgres' 'flexible-server' 'update' '-g' 'rg' '-n' 'nasc-ha-930' '--zonal-resiliency' 'Enabled' '--standby-zone' '2'
{
"availabilityZone": "1",
...
"fullyQualifiedDomainName": "nasc-ha-930.postgres.database.azure.com",
"highAvailability": {
"mode": "ZoneRedundant",
"standbyAvailabilityZone": "2",
"state": "Healthy"
},
History Notes
[RDBMS]
az postgres flexible-server update: Fix bug for using argument--standby-zonewhen enabling high availability