Skip to content

[MySQL] az mysql flexible-server create/update: Update --storage-redundancy parameter and add --backup-interval#31813

Merged
evelyn-ys merged 4 commits intoAzure:devfrom
honghr:storage-redundancy-bugfix
Jul 16, 2025
Merged

[MySQL] az mysql flexible-server create/update: Update --storage-redundancy parameter and add --backup-interval#31813
evelyn-ys merged 4 commits intoAzure:devfrom
honghr:storage-redundancy-bugfix

Conversation

@honghr
Copy link
Contributor

@honghr honghr commented Jul 15, 2025

Related command

az mysql flexible-server create --storage-redundancy
az mysql flexible-server replica create --storage-redundancy
az mysql flexible-server update --backup-interval

Description

Add new parameter --backup-interval to server update command. And update --storage-redundancy default value to LocalRedundancy.

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


This checklist is used to make sure that common guidelines for a pull request are followed.

Copilot AI review requested due to automatic review settings July 15, 2025 16:04
@honghr honghr requested a review from evelyn-ys as a code owner July 15, 2025 16:04
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jul 15, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️latest
️✔️3.12
️✔️3.9

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jul 15, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️mysql
rule cmd_name rule_message suggest_message
⚠️ 1008 - ParaPropAdd mysql flexible-server create cmd mysql flexible-server create update parameter storage_redundancy: added property default=LocalRedundancy
⚠️ 1008 - ParaPropAdd mysql flexible-server replica create cmd mysql flexible-server replica create update parameter storage_redundancy: added property default=LocalRedundancy
⚠️ 1006 - ParaAdd mysql flexible-server update cmd mysql flexible-server update added parameter backup_interval

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 15, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Contributor

Copilot AI left a 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 adjusts the MySQL flexible-server commands by changing the default storage redundancy to LocalRedundancy and adding a new --backup-interval parameter to the update command.

  • Default --storage-redundancy is now set to LocalRedundancy for both create and update.
  • Introduces --backup-interval on az mysql flexible-server update and wires it through to the SDK and instance object.
  • Removes custom storage redundancy validation and helper in favor of the new default.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/azure-cli/azure/cli/command_modules/mysql/custom.py Removed manual storage_redundancy logic/validator, added backup_interval to update flow
src/azure-cli/azure/cli/command_modules/mysql/_validators.py Dropped storage_redundancy_validator definition and calls
src/azure-cli/azure/cli/command_modules/mysql/_params.py Set default for storage_redundancy to LocalRedundancy and added backup_interval CLI argument
Comments suppressed due to low confidence (4)

src/azure-cli/azure/cli/command_modules/mysql/custom.py:379

  • The storage_redundancy argument was removed from the create call, so any user-provided value will be ignored. Reintroduce passing storage_redundancy (defaulting to LocalRedundancy) into the SDK model.
                              accelerated_logs=accelerated_logs,

src/azure-cli/azure/cli/command_modules/mysql/custom.py:1049

  • There are no existing tests covering the new backup_interval assignment. Consider adding unit tests to verify that backup_interval_hours is set appropriately when provided.
    if backup_interval:

src/azure-cli/azure/cli/command_modules/mysql/_params.py:482

  • [nitpick] The new backup_interval argument needs a help string describing its purpose and valid range so users understand how to use it.
        c.argument('backup_interval', arg_type=backup_interval_arg_type)

src/azure-cli/azure/cli/command_modules/mysql/custom.py:1026

  • The update call now accepts backup_interval but no longer accepts or sets storage_redundancy. This will break any custom redundancy settings. Add storage_redundancy=storage_redundancy back into the update payload.
                              iops=iops,

@honghr honghr changed the title [MySQL]az mysql flexible-server create/update: update --storage-redundancy parameter and --backup-interval [MySQL] az mysql flexible-server create/update: update --storage-redundancy parameter and --backup-interval Jul 16, 2025
@evelyn-ys evelyn-ys changed the title [MySQL] az mysql flexible-server create/update: update --storage-redundancy parameter and --backup-interval [MySQL] az mysql flexible-server create/update: Update --storage-redundancy parameter and add --backup-interval Jul 16, 2025
@evelyn-ys evelyn-ys merged commit 541a7eb into Azure:dev Jul 16, 2025
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Backup Storage az storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants