Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/azure-cli/azure/cli/command_modules/sql/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3140,6 +3140,16 @@ def update_long_term_retention(
if time_based_immutability_mode.lower() not in ['unlocked', 'locked']:
raise CLIError('Invalid value for time-based immutability mode. '
'Valid values are "unlocked" or "locked".')
if time_based_immutability_mode.lower() == 'locked':
if not yes:
confirmation = prompt_y_n(
"Once locked, immutable backups cannot be modified or deleted for the full "
"retention period. There is no extra cost to enable immutability, but standard "
"backup storage charges apply. Note: The logical Azure SQL Server cannot be "
"deleted during the retention period. Do you want to proceed?",
default='n')
if not confirmation:
return
Comment on lines +3143 to +3152
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

When users pass both --tb-immutability Enabled and --tb-immutability-mode Locked in the same call, they will be prompted twice (once for enabling immutability above, and again here for locking). Consider consolidating into a single confirmation when mode is locked (e.g., skip the earlier prompt or make the earlier prompt conditional on mode != locked) to avoid redundant interactive prompts.

Copilot uses AI. Check for mistakes.

kwargs['weekly_retention'] = weekly_retention

Expand Down
Loading