Skip to content

[FEATURE] [SQL database] Create new SQLDatabase with initial properties (backupRetentionDays, collation) #148

@dzsquared

Description

@dzsquared

Use Case / Problem

When provisioning databases via CI/CD, users want to create a new SQL database already configured (retention + collation) in one step. Without this, automation must do a separate “create then set properties” sequence, which is slower and can fail mid-way leaving drift.

Proposed Solution

Extend the default create for *.SQLDatabase to accept initial properties through -p (property bag), so creation and configuration happen atomically where supported. To support alternative create types (like restore), use a mode property (optional) to distinguish this behavior as mode=new.

Sample commands:

  • create dbname.SQLDatabase -p "mode=new,backupRetentionDays=21"
  • create dbname.SQLDatabase -p "mode=new,collation=SQL_Latin1_General_CP1_CI_AS"
  • create dbname.SQLDatabase -p "mode=new,backupRetentionDays=21,collation=SQL_Latin1_General_CP1_CI_AS"

Notes / expectations:

  • Support backupRetentionDays and collation in mode=new.
  • If some properties can’t be set at create-time, CLI should clearly say and either:
    • fail fast, or
    • apply post-create updates in a single command execution (explicit behavior documented).

Alternatives Considered

  • Running separate steps: create then multiple set calls (slower, non-atomic, can leave drift on partial failure).

Impact Assessment

  • This aligns with Microsoft Fabric roadmap items

Implementation Attestation

  • I understand this feature should maintain backward compatibility with existing commands
  • I confirm this feature request does not introduce performance regressions for existing workflows
  • I acknowledge that new features must follow fabric-cli's established patterns and conventions

Implementation Notes

-p parsing should follow existing conventions for mode and additional properties; error messages should surface invalid/unsupported properties clearly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis is a new issue that needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions