Skip to content

Conversation

@rambabu-yalla
Copy link
Contributor

@rambabu-yalla rambabu-yalla commented Jan 8, 2026

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings January 8, 2026 14:18
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

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 fixes a bug in the computation of SoftDeleteRetentionDays for the Set-AzSqlServer cmdlet. Previously, when updating a server property without specifying SoftDeleteRetentionDays, the value would be inadvertently reset to 0 because the API returns 0 for both null and explicitly disabled states. The fix simplifies the logic to return null when neither parameter is specified, allowing the API to preserve the existing value.

Key Changes:

  • Removed the existingValue parameter from ComputeSoftDeleteRetentionDays method
  • Simplified the method logic to return null when neither SoftDeleteRetentionDays nor EnableSoftDelete is provided
  • Updated the call site in SetAzureSqlServer.cs to not pass the existing value

Reviewed changes

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

File Description
src/Sql/Sql/Server/Cmdlet/SetAzureSqlServer.cs Updated to call ComputeSoftDeleteRetentionDays without passing existing value; added explanatory comments
src/Sql/Sql/Server/Cmdlet/AzureSqlServerCmdletBase.cs Simplified ComputeSoftDeleteRetentionDays method to return null when no parameters are specified, removing the existingValue parameter

@wyunchi-ms wyunchi-ms changed the base branch from main to release-2026-01-13 January 9, 2026 02:41
@wyunchi-ms
Copy link
Contributor

/azp run azure-powershell - security-tools

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@wyunchi-ms wyunchi-ms enabled auto-merge (squash) January 9, 2026 03:01
@wyunchi-ms wyunchi-ms merged commit aed0221 into Azure:release-2026-01-13 Jan 9, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants