Skip to content

Conversation

@rambabu-yalla
Copy link

@rambabu-yalla rambabu-yalla commented Oct 11, 2025

Related command
The change includes

  1. Modify command: az sql server create

    • Added new parameter --soft-delete-retention-days
    • az sql server create -l westus -g mygroup -n myserver -u myadminuser -p myadminpassword --soft-delete-retention-days 7
  2. Modify command: az sql server update
    - Added new parameter --soft-delete-retention-days
    - az sql server update --name MyAzureSQLServer --resource-group MyResourceGroup --soft-delete-retention-days 5

  3. Add new command: az sql server deleted-server show
    - az sql server deleted-server show --name servername --location eastasia

  4. Add new command: az sql server deleted-server list
    - az sql server deleted-server list --location eastasia

  5. Add new command: az sql server restore,

    • az sql server restore -n myserver -g mygroup -l westus2

Description
This is to support soft delete public preview feature

Testing Guide

  1. Create a server with soft delete enabled with retention days, 7
    az sql server create -l westus -g mygroup -n myserver -u myadminuser -p myadminpassword --soft-delete-retention-days 7

  2. Modify soft delete retention period.
    az sql server update --name myserver --resource-group mygroup --soft-delete-retention-days 5

Delete a soft delete enabled server

  1. show a deleted server
    az sql server deleted-server show --name myserver --location westus

  2. Restore a deleted server.
    az sql server restore -n myserver -g mygroup -l westus

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

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

azure-client-tools-bot-prd bot commented Oct 11, 2025

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

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

azure-client-tools-bot-prd bot commented Oct 11, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️sql
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd sql server create cmd sql server create added parameter enable_soft_delete
⚠️ 1006 - ParaAdd sql server create cmd sql server create added parameter soft_delete_retention_days
⚠️ 1011 - SubgroupAdd sql server deleted-server sub group sql server deleted-server added
⚠️ 1001 - CmdAdd sql server restore cmd sql server restore added
⚠️ 1006 - ParaAdd sql server update cmd sql server update added parameter enable_soft_delete
⚠️ 1006 - ParaAdd sql server update cmd sql server update added parameter soft_delete_retention_days

@yonzhan
Copy link
Collaborator

yonzhan commented Oct 11, 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>

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot SQL az sql labels Oct 11, 2025
@rambabu-yalla rambabu-yalla marked this pull request as ready for review October 14, 2025 07:07
Copilot AI review requested due to automatic review settings October 14, 2025 07:07
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 introduces changes to support SQL Server soft delete functionality, adding new commands and parameters for server creation, update, and restoration operations. The changes enable users to create SQL servers with soft delete protection, modify soft delete settings on existing servers, and restore previously deleted servers.

  • Adds new az sql server restore command for recovering deleted SQL servers
  • Extends az sql server create and az sql server update commands with soft delete parameters
  • Implements comprehensive validation for soft delete retention days (1-7 days when enabled, 0 when disabled)

Reviewed Changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test_sql_commands.py Added comprehensive test suite for soft delete functionality with multiple scenarios
test recordings (2 files) Added test recording files for new soft delete test cases
custom.py Implemented server restore functionality and soft delete parameter handling
commands.py Added new restore command to SQL server command group
_validators.py Added validation logic for soft delete parameters with proper error handling
_util.py Added utility function to access deleted servers API operations
_params.py Added command line parameters for soft delete options
_help.py Added help documentation and examples for new soft delete features
Comments suppressed due to low confidence (2)

src/azure-cli/azure/cli/command_modules/sql/_help.py:1

  • The help message should start with a verb in active voice. Consider changing 'Set whether soft delete is enabled or not' to 'Enable or disable soft delete protection' to follow the help message format guidelines.
# coding=utf-8

src/azure-cli/azure/cli/command_modules/sql/_help.py:1

  • The help message should start with a verb in active voice. Consider changing 'The number of days to retain soft deleted resources' to 'Specify the number of days to retain soft deleted resources' to follow the help message format guidelines.
# coding=utf-8

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rambabu-yalla rambabu-yalla requested a review from Copilot October 14, 2025 07:18
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

Copilot reviewed 11 out of 13 changed files in this pull request and generated 5 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rambabu-yalla rambabu-yalla requested a review from Copilot October 17, 2025 05:48
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

Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/azure-cli/azure/cli/command_modules/sql/custom.py:4436

  • The docstring uses triple single quotes instead of triple double quotes. Python convention is to use triple double quotes for docstrings.
    '''
    Creates a server.
    '''

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pranavathalye
Copy link

Can you please add negative test cases for each validation scenario related to options enable soft delete and retention days?

Copy link

@pranavathalye pranavathalye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with review.

@rambabu-yalla
Copy link
Author

Can you please add negative test cases for each validation scenario related to options enable soft delete and retention days?

Added.

@evelyn-ys
Copy link
Member

@evelyn-ys : Sorry, I have set the PR to draft state as we are planning to target 11/25.Please do not merge into 11/11 milestone.

@rambabu-yalla Do you want to merge this PR now?

@rambabu-yalla
Copy link
Author

@evelyn-ys : Sorry, I have set the PR to draft state as we are planning to target 11/25.Please do not merge into 11/11 milestone.

@rambabu-yalla Do you want to merge this PR now?
@evelyn-ys : No, please change the milestone to 12/30.

@evelyn-ys
Copy link
Member

@rambabu-yalla Please remove the draft state when you are ready for review and merge

@rambabu-yalla rambabu-yalla marked this pull request as ready for review January 12, 2026 18:11
@rambabu-yalla
Copy link
Author

Can you please add negative test cases for each validation scenario related to options enable soft delete and retention days?

Added negative tests

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

Copilot reviewed 16 out of 25 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rambabu-yalla
Copy link
Author

@DanielMicrosoft : Can you please run the pipeline on this PR and change the milestone to upcoming milestone.

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 customer-reported Issues that are reported by GitHub users external to the Azure organization. SQL az sql

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants