Skip to content

az mysql flexible-server update doesn't allow to disable CMK data encryption for replica server #30003

Description

@kamilzzz

Describe the bug

Azure CLI does not allow to disable CMK encryption for Azure MySQL Flexibler Server with Replica role.
Resource Provider API allows such operation and completes it successfully.

According to my knowledge, it is perfectly valid to disable CMK encryption on a server with replica role as encryption mechanism is independent for primary and replica roles.

Related command

az mysql flexible-server update

Errors

Data encryption cannot be modified on a server with replication role. Use the primary server instead.

Issue script & Debug output

Create MySQL Flexible server replica with CMK enryption enabled.
Run az mysql flexible-server update --disable-data-encryption on such replica.
Operation fails on the client side validation performed by Azure CLI.

if (instance and instance.replication_role == "Replica") and (disable_data_encryption or byok_key):
raise CLIError("Data encryption cannot be modified on a server with replication role. "
"Use the primary server instead.")

Expected behavior

Operation should succeed.

Environment Summary

azure-cli 2.64.0

core 2.64.0
telemetry 1.1.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botMySQLService 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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions