Skip to content

az postgres flexible-server replica promote failing when doing planned promote #33776

Closed

Description

@narayana471

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

  1. added
    bugThis issue requires a change to an existing behavior in the product in order to be resolved.
    on Jul 23, 2026
  2. yonzhan commented on Jul 23, 2026

    @yonzhan
    Collaborator

    Thank you for opening this issue, we will look into it.

  3. a0x1ab commented on Jul 23, 2026

    @a0x1ab
    Member

    Bug Analysis

    Regression between azure-cli 2.87.0 and 2.88.0: az postgres flexible-server replica promote with --promote-mode SwitchOver --promote-option Planned now fails with:

    (MissingRequiredParameter) Parameter 'properties.sourceServerResourceId' must be specified. This parameter cannot be NULL or empty.
    

    The service (Postgres Flexible Server RP) requires properties.sourceServerResourceId to be set on the update payload for a planned promote of a read replica, but the CLI's rdbms module custom command for replica promote is not populating this field before calling the underlying begin_update operation. Likely the fix needs to look up the read replica's source_server_resource_id (available via replica show/the server's replica.source_server_resource_id property, as the reporter confirmed show returns it) and pass it through in the update body when --promote-mode SwitchOver --promote-option Planned is 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 ensure sourceServerResourceId is 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 promote

    PR 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):

    [RDBMS] Fix #33776: `az postgres flexible-server replica promote`: Populate sourceServerResourceId when doing a planned promote
    

    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:

    • Link the issue — start the Description with a closing keyword so the PR auto-links and closes it: Fixes #33776.
    • Related command — the az ... command this affects.
    • Description (mandatory) — why the bug happens, what you changed, and the resulting behavior.
    • Testing Guide — example command(s) showing the fix works.
    • History Notes — leave the title to drive the history note, or add extra lines in the same format (component in brackets + the command in backticks), e.g. [RDBMS] `az <command>`: <note>.
    • Keep the template checklist and tick the items you've satisfied.

    Posted by agent-assist (autonomous bug-fix pipeline).

  4. added a commit that references this issue on Jul 23, 2026
    43bc36c
  5. added a commit that references this issue on Aug 17, 2026
    9ee8f0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Auto-AssignAuto assign by botPostgreSQLService AttentionThis issue is responsible by Azure service team.act-codegen-extensibility-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions