Skip to content

[CosmosDB][DoNotMerge] API Version 2026-04-01-preview changes#9839

Open
pjohari-ms wants to merge 22 commits into
Azure:mainfrom
pjohari-ms:cdb260401preview
Open

[CosmosDB][DoNotMerge] API Version 2026-04-01-preview changes#9839
pjohari-ms wants to merge 22 commits into
Azure:mainfrom
pjohari-ms:cdb260401preview

Conversation

@pjohari-ms

Copy link
Copy Markdown
Member

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

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings April 30, 2026 21:31
@azure-client-tools-bot-prd

Copy link
Copy Markdown
Validation for Breaking Change Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @pjohari-ms,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@yonzhan

yonzhan commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions

Copy link
Copy Markdown
Contributor

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>

@yonzhan yonzhan assigned calvinhzy and unassigned evelyn-ys Apr 30, 2026
mohhef and others added 14 commits May 20, 2026 18:43
- Add softdeleted-account, softdeleted-database, softdeleted-container
  command groups for list, show, recover (restore), and delete (purge)
- Fix ManagedServiceIdentityUserAssignedIdentity rename (singular->plural)
- Fix Location model impedance (bundled vs vendored SDK types)
- Route cosmosdb_sql_sdk through vendored SDK for consistency
- Unwrap list results (.value) for new SDK response shape
- Add env-var override for API version targeting older stamps
- Add 6 scenario tests (account/database/container x recover/purge)
- All 6 tests pass live against test12

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…p, command groups)

- Add client factories for soft-deleted accounts/databases/containers
- Add command group registrations to wire custom.py functions as CLI commands
- Add parameter definitions for all soft-delete commands
- Add help text with examples for all soft-delete commands

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add --soft-deletion-enabled, --sd-retention, --min-purge-minutes params to cosmosdb update
- Wire soft_delete_configuration through cli_cosmosdb_update, cli_cosmosdb_create, and _create_database_account
- Add help example for enabling soft deletion via cosmosdb update

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add 1.7.0 release notes for soft-delete command groups
- Add linter exclusions for softdeleted-database/container list commands
  (no_ids_for_list_commands - these use location-based params, not resource IDs)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…6-04-01-preview

- Switched recordings to public Azure (management.azure.com) from CanaryCloud (centraluseuap)
- Updated API version from 2025-11-01-preview to 2026-04-01-preview (matches manifest)
- Switched test region from westus to westus2 (sub capacity)
- Added RG tagging to bypass Az.Sec.DisableLocalAuth.CosmosDB policy on test infra
- Removed unreliable ARM 'cosmosdb show' check after account recover (stale-cache); rely on soft-deleted-list canonical check
- All 6 tests passed live (~33min) and in playback (~12s)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The cosmosdb_sql_sdk redirect to vendored SDK was unrelated cleanup that crept into the soft-delete PR. Soft-delete commands use their own SDK types (cosmosdb_softdeleted_*_sdk) which are unaffected.

Reverted both occurrences (line 58 and duplicate at line 320) back to the public azure.mgmt.cosmosdb.operations#SqlResourcesOperations namespace.

Verified: all 6 soft-delete playback tests still PASS (11.82s).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the new Continuous35Days (PITR Premium) continuous backup tier
alongside the existing Continuous7Days and Continuous30Days tiers.

- Update README with create/update examples for 35-day retention
- Add test_cosmosdb_sql_continuous35days provisioning test
- Extend periodic-to-continuous migration test to cover 35-day upgrade

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…AssignedIdentities

- Add live test recording for test_cosmosdb_sql_continuous35days
- Update recording for test_cosmosdb_sql_migrate_periodic_to_continuous7days
- Fix renamed SDK class: ManagedServiceIdentityUserAssignedIdentity -> ManagedServiceIdentityUserAssignedIdentities

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add Continuous35Days backup tier support for CosmosDB
# Conflicts:
#	src/cosmosdb-preview/HISTORY.rst
Switch soft-delete operations_tmpl and model imports from the vendored SDK path to azure.mgmt.cosmosdb. The regenerated SDK will provide these classes at this path.
Collapses the three soft-delete update flags (--soft-deletion-enabled, --sd-retention, --min-purge-minutes) into one --soft-delete-config argument that maps to the single soft_delete_configuration property on the account. The value is accepted as a JSON object or a path to a JSON file and is parsed/validated into a SoftDeleteConfiguration model via a new validator.

Soft delete can only be configured via update (platform limitation), so the non-functional create-time wiring is removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
[CosmosDB] Add soft-delete CLI support for SQL databases and containers and Accounts
@pjohari-ms pjohari-ms requested a review from wangzelin007 as a code owner June 21, 2026 17:07
@yonzhan yonzhan requested review from Pan-Qi and removed request for calvinhzy June 21, 2026 23:15
@yonzhan yonzhan assigned Pan-Qi and unassigned calvinhzy Jun 21, 2026
@yonzhan yonzhan requested review from jsntcy and removed request for evelyn-ys June 21, 2026 23:16

@Pan-Qi Pan-Qi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please fix the linting issue.

- Fix mongo role/user definition handlers to use keyword arguments after the regenerated SDK reordered parameters to (resource_group_name, account_name, <id>, parameters)

- Fix SoftDeleteConfiguration import to load from the vendored SDK instead of the base azure-mgmt-cosmosdb package

- Add --disable-local-auth support to 'cosmosdb create' and 'cosmosdb restore'
- Re-record passing scenario tests against the new API version

- Add --disable-local-auth to account creation in scenario tests (SafeSecrets policy requirement)

- Remap regions for environment-gated in-account restore tests
…eview

- Set ResourceGroupPreparer location to a PITR-enabled region so the account ARM location (derived from the resource group) supports continuous backup

- Re-record InAccountRestore (SQL/Mongo), Table/Gremlin restore, and continuous-tier scenario tests

- All 18 regenerated cassettes verified in playback
- mongocluster crud/firewall require M40+HA tier availability not present in the recording subscription

- sql throughput bucketing runs against a pre-existing feature-flagged account and is not recordable
…04-01-preview

- Remap table_account_restore_using_create from westus2 to eastus2 where Table + continuous backup is supported

- Cassette regenerated and verified in playback
@vinhms

vinhms commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

lgtm

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 CosmosDB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants