Repository navigation
az postgres flexible-server replica promote failing when doing planned promote #33776
Description
Describe the bug
In version 2.87.0 * , this command worked without issue.
az postgres flexible-server replica promote --resource-group $ResourceGroup
--name $ReadReplicaName --promote-mode SwitchOver
--promote-option Planned
But when doing promote in 2.88.0 * version, it is failing with bellow error. I did check there is no parameter to provide source server. Also I ran show for readable replica which has source server info.
(MissingRequiredParameter) Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
Code: MissingRequiredParameter
Message: Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
Related command
Used the same command in both version
az postgres flexible-server replica promote --resource-group $ResourceGroup
--name $ReadReplicaName --promote-mode SwitchOver
--promote-option Planned
Errors
(MissingRequiredParameter) Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
Code: MissingRequiredParameter
Message: Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
Issue script & Debug output
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/postgresqlflexibleservers/operations/_operations.py", line 3640, in begin_update
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/postgresqlflexibleservers/operations/_operations.py", line 3503, in _update_initial
azure.core.exceptions.HttpResponseError: (MissingRequiredParameter) Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
Code: MissingRequiredParameter
Message: Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
cli.azure.cli.core.azclierror: (MissingRequiredParameter) Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
Code: MissingRequiredParameter
Message: Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
az_command_data_logger: (MissingRequiredParameter) Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
Code: MissingRequiredParameter
Message: Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
Expected behavior
Should make readable replica as primary
Environment Summary
azure-cli 2.88.0
core 2.88.0
telemetry 1.1.0
Extensions:
arcdata 1.5.24
Dependencies:
msal 1.36.0
azure-mgmt-resource 24.0.0
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users*.azure'
Extensions directory 'C:\Users*.azure\cliextensions'
Python (Windows) 3.14.5 (tags/v3.14.5:5607950, May 10 2026, 10:43:50) [MSC v.1944 64 bit (AMD64)]
Legal docs and information: aka.ms/AzureCliLegal
Additional context
No response
Activity
yonzhan commentedon Jul 23, 2026
Thank you for opening this issue, we will look into it.
a0x1ab commentedon Jul 23, 2026
Bug Analysis
Regression between azure-cli 2.87.0 and 2.88.0:
az postgres flexible-server replica promotewith--promote-mode SwitchOver --promote-option Plannednow fails with:The service (Postgres Flexible Server RP) requires
properties.sourceServerResourceIdto be set on the update payload for a planned promote of a read replica, but the CLI'srdbmsmodule custom command forreplica promoteis not populating this field before calling the underlyingbegin_updateoperation. Likely the fix needs to look up the read replica'ssource_server_resource_id(available viareplica show/the server'sreplica.source_server_resource_idproperty, as the reporter confirmedshowreturns it) and pass it through in the update body when--promote-mode SwitchOver --promote-option Plannedis used, restoring the pre-2.88.0 behavior.Please investigate
src/azure-cli/azure/cli/command_modules/rdbms/(custom command implementation for flexible-server replica promote) to find where the update payload is constructed and ensuresourceServerResourceIdis populated automatically instead of requiring the user to supply it.Use this EXACT PR title:
[RDBMS] Fix #33776:az postgres flexible-server replica promote: Populate sourceServerResourceId when doing a planned promotePR title & description format (required)
This repo enforces a PR format (guide). Please author the PR exactly as follows or CI's Check the Format of Pull Request Title and Content will fail.
Use this EXACT PR title (copy verbatim, do not reword):
Keep the backticks around the command and the
Fix #33776:prefix. You may only adjust the wording after the command (the final summary) if the fix changes; the[RDBMS]prefix, issue link, and backticked command must stay.Description — follow the PR template and fill in:
Fixes #33776.az ...command this affects.[RDBMS] `az <command>`: <note>.Posted by agent-assist (autonomous bug-fix pipeline).
[RDBMS] Fix #33776: `az postgres flexible-server replica promote`: Po…
[RDBMS] Fix #33776: `az postgres flexible-server replica promote`: Po…