`az mysql flexible-server update` doesn't allow to disable CMK data encryption for replica server
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 64
Description
### 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.
https://github.com/Azure/azure-cli/blob/3194af8f245f6d7e30ad70813c58eef779142482/src/azure-cli/azure/cli/command_modules/mysql/_validators.py#L299-L302
### Expected behavior
Operation should succeed.
### Environment Summary
azure-cli 2.64.0
core 2.64.0
telemetry 1.1.0
### Additional context
_No response_
Contributor guide
Research direction
Start in src/azure-cli/azure/cli/command_modules/mysql/_validators.py at lines 299-302, then inspect the validation used by az mysql flexible-server update. Reproduce the replica case with --disable-data-encryption and verify that client-side validation no longer rejects it and the operation succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100