[SQL] Make deleted server location optional - #33918
Merged
Qi Pan (Pan-Qi) merged 1 commit intoAug 19, 2026
Merged
Conversation
|
Hi rambabu-yalla, |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested a review
from Yong Zhang (yonzhan)
August 18, 2026 13:32
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the az sql server deleted-server list command to make --location optional, enabling subscription-wide listing of deleted SQL servers when no location is provided, while preserving the existing location-scoped behavior when --location is specified.
Changes:
- Updated the command implementation to call a subscription-level SDK list API when
--locationis omitted. - Adjusted CLI parameter metadata and help text/examples to reflect the optional
--location. - Added/updated scenario tests and refreshed recordings for subscription-wide list behavior and wrong-location show behavior.
Reviewed changes
Copilot reviewed 7 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/sql/custom.py | Makes deleted-server list location optional and switches to subscription-wide list when omitted. |
| src/azure-cli/azure/cli/command_modules/sql/_params.py | Removes the required=True constraint and updates parameter help text for --location. |
| src/azure-cli/azure/cli/command_modules/sql/_help.py | Updates command short summary and adds an example for subscription-wide listing. |
| src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py | Enhances deleted-server validations and adds a test for listing without location. |
| src/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_deleted_server_list_without_location.yaml | New recording for subscription-wide deleted-server list. |
| src/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_deleted_server_show_wrong_location.yaml | New recording for showing a deleted server with an incorrect location. |
| src/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_deleted_server_list_empty_location.yaml | Refreshes recording for location-scoped list behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+4454
to
+4456
| if location: | ||
| return client.list_by_location(location) | ||
| return client.list() |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Qi Pan (Pan-Qi)
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 PR Validation —⚠️ Review suggested
Related command
az sql server deleted-server list
Description
This PR makes [--location] optional for
az sql server deleted-server listPreviously, the command required [--location] and only listed deleted SQL servers for a specific Azure region. With this change:
az sql server deleted-server list --location <location>keeps the existing location-scoped behavior.az sql server deleted-server listlists deleted SQL servers across the subscription by using the SDK subscription-level list API.The command help and examples are updated, and server deleted/restore scenario recordings are refreshed.
Testing Guide
Run location-scoped deleted-server list:
az sql server deleted-server list --location westus2
Run subscription-wide deleted-server list:
az sql server deleted-server list
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 featureThis 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.