Skip to content

[SQL] Make deleted server location optional - #33918

Merged
Qi Pan (Pan-Qi) merged 1 commit into
Azure:devfrom
rambabu-yalla:ramyal/UpdateAzDeletedServercmd
Aug 19, 2026
Merged

[SQL] Make deleted server location optional#33918
Qi Pan (Pan-Qi) merged 1 commit into
Azure:devfrom
rambabu-yalla:ramyal/UpdateAzDeletedServercmd

Conversation

@rambabu-yalla

@rambabu-yalla rambabu-yalla commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Tests
⚠️ None ️✔️ 130/130
⚠️AzureCLI-BreakingChangeTest
⚠️sql
rule cmd_name rule_message suggest_message
⚠️ 1009 - ParaPropRemove sql server deleted-server list cmd sql server deleted-server list update parameter location: removed property required=True

Related command

az sql server deleted-server list

Description

This PR makes [--location] optional for az sql server deleted-server list

Previously, 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 list lists 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 feature


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

@rambabu-yalla
rambabu-yalla requested a review from a team as a code owner August 18, 2026 13:32
Copilot AI lite review requested due to automatic review settings August 18, 2026 13:32
@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi rambabu-yalla,
Since the current milestone time is less than 7 days, this pr may not catch up with this release.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 --location is 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()
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@Pan-Qi
Qi Pan (Pan-Qi) merged commit 4c61616 into Azure:dev Aug 19, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants