Conversation
️✔️AzureCLI-FullTest
|
|
Hi @achyuth-ms, |
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in az sql db update where updating a database from serverless to provisioned compute tier would incorrectly default to service objective 'S0' instead of preserving the user-specified value.
Key Changes:
- Modified compute model detection logic to use the requested
service_objectiveparameter instead of only checking the current database SKU - Added null safety check to
_is_serverless_slofunction - Added comprehensive test case validating serverless-to-provisioned updates with explicit service objective
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/sql/custom.py | Fixed compute model detection to respect user-specified service objective and added null safety check |
| src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py | Added test case validating the fix for serverless-to-provisioned updates |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Remove excessive blank lines at the end of the test method. Two blank lines are sufficient between top-level definitions.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
az sql db update: Prevent overwrite of SLO when updating from serverless to provisioned
… serverless to provisioned (Azure#32292)
Related command
az sql db update
Description
Fixes a bug where updating a database from serverless to provisioned compute tier would incorrectly overwrite the service objective name to 'S0' instead of using the user-specified service objective.
Previously, when converting from serverless (e.g., GP_S_Gen5_1) to a provisioned tier (e.g., Standard S1), the code would default to 'S0' regardless of the --service-objective parameter value.
This fix ensures that when a user explicitly specifies --service-objective during a serverless-to-provisioned update, that value is preserved and used instead of being overwritten.
Testing Guide
Test case added:
test_sql_db_serverless_to_provisioned_slo_updateSteps to reproduce the original bug:
az sql db create --service-objective GP_S_Gen5 --compute-model Serverlessaz sql db update --service-objective S1 --edition StandardThe test validates:
History Notes
[SQL]
az sql db update: Prevent overwrite of SLO when updating from serverless to provisionedThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.