Skip to content

[SQL] Add short-term retention immutability command models - #1130

Open
svmicano wants to merge 2 commits into
Azure:mainfrom
svmicano:feature-sql-str-immutability
Open

svmicano wants to merge 2 commits into
Azure:mainfrom
svmicano:feature-sql-str-immutability

Conversation

@svmicano

@svmicano svmicano commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

please provide the link to the corresponding pull request in Azure/azure-cli or Azure/azure-cli-extensions:

Azure/azure-cli#34207

Description

Generate SQL short-term retention policy command models from the public 2026-08-01-preview REST specifications using aaz-dev-tools 4.7.1.

  • Add GET/show and PUT/set models for SQL Database, live managed databases, and restorable dropped managed databases (three resources, six commands).
  • Model lockImmutability and immutabilityStatus; hide the shared-schema lock argument for dropped managed databases.
  • Configure the existing SQL command names and argument aliases. Retain an extensible policy-name argument for the CLI's existing wait-command compatibility.
  • Keep the specification's declared polling metadata intact. The linked CLI PR intentionally applies its already-tested ARM final-policy-read behavior in a small custom adapter.

The linked CLI implementation generates unregistered bases, keeping its existing public handlers for conditional irreversible-action confirmation, required MI retention, dropped-database validation/routing, and other compatibility behavior. The dropped-policy command subgroup is internal and does not introduce public CLI commands.

REST source: Azure/azure-rest-api-specs commit 2e2b290fd446b03bbddcdc31098ff97e7218f0cf. CLI implementation: commit 03307dd24188df4fce24d1223c51430d19eb144f in Azure/azure-cli#34207.

Validation

  • Passed: E:\CLI\aaz-env\Scripts\aaz-dev.exe command-model verify --aaz-path E:\CLI\aaz --target sql (exit 0).
  • Passed: all 50 linked CLI unit/safety/recorded scenario tests with network connections blocked; zero failures, errors, or skips.
  • Passed: linked CLI flake8, generated-file compilation, and adapter pylint. Legacy custom.py has no new pylint diagnostics versus its parent; its environment-specific baseline limitations are documented in the CLI PR.
  • No REST specification changes or hand edits to generated CLI files. Additional authorized live CLI policy validation is documented below and in the linked CLI PR.

The exact CLI validation commands/results are recorded in Azure/azure-cli#34207. The full-repository AAZ verification was not completed locally; the focused SQL check passed and hosted verification remains authoritative.

SQL integer-wire compatibility

The linked CLI PR now contains a targeted custom serialization correction for diffBackupIntervalInHours: the current Swagger numeric enum generates floating-point values, while the SQL service requires integer JSON tokens. The compatibility adapter preserves omission, rejects fractional input, and leaves these generated AAZ models unchanged.

Validation after the correction: 50 offline tests passed and eight live interval updates passed across disposable Locked/Enabled SQL databases, including normal and no-wait paths. Actual outgoing JSON integer types were checked, original policy values restored, and existing resources verified unchanged. Exact commands and limitations are documented in Azure/azure-cli#34207.

Generate GET and PUT models for SQL DB, managed DB, and restorable dropped managed DB policies using 2026-08-01-preview. Corresponding CLI PR: Azure/azure-cli#34207.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The public SQL STR handlers supply the default policy name internally. Keep the command examples runnable through those existing handlers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant