{Cosmos DB} az cosmosdb: Revert Add support for API version 2026-03-15(#33303) - #33802
Merged
Conversation
…3-15 (Azure#33303)" This reverts commit 51bcb92.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reverts the previously introduced Cosmos DB API version 2026-03-15 support (reverting commit 51bcb920...), primarily by rolling back the azure-mgmt-cosmosdb dependency and updating Cosmos DB-related tests/recordings accordingly.
Changes:
- Downgrade
azure-mgmt-cosmosdbfrom10.0.0to9.9.0across setup/requirements files. - Revert Cosmos DB test scenarios and recordings to use API version
2025-10-15(and related command/recording expectations). - Adjust Cosmos DB module implementation details (restore params, transformers behavior, and marking fleet-related command groups as preview).
Reviewed changes
Copilot reviewed 25 out of 102 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/setup.py | Downgrades azure-mgmt-cosmosdb dependency to 9.9.0. |
| src/azure-cli/requirements.py3.windows.txt | Aligns Windows pinned dependency to azure-mgmt-cosmosdb==9.9.0. |
| src/azure-cli/requirements.py3.Linux.txt | Aligns Linux pinned dependency to azure-mgmt-cosmosdb==9.9.0. |
| src/azure-cli/requirements.py3.Darwin.txt | Aligns macOS pinned dependency to azure-mgmt-cosmosdb==9.9.0. |
| src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_endpoint_connection_cosmosdb.yaml | Reverts recorded Cosmos DB ARM API version back to 2025-10-15. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb-burst-capacity-scenario.py | Updates scenario command arguments in line with the revert. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_prpp_autoscale_scenario.py | Updates scenario command arguments in line with the revert. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_priority_based_execution_scenario.py | Updates scenario command arguments in line with the revert. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_fleet_fleetspace_fleetspaceAccount_scenario.py | Updates scenario commands (including removing shared-key/local-auth flags) consistent with rollback. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_commands.py | Broadly reverts/create-restore scenario CLI argument usage to match older behavior. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_backuprestore_scenario.py | Reverts restore/XRR test logic and unit-test mocking setup. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/recordings/test_cosmosdb_postgres_list_cluster.yaml | Adds (reverted) recording for Postgres cluster list-by-resource-group. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/recordings/test_cosmosdb_mongodb_container_backupinfo.yaml | Adds (reverted) recording for MongoDB container backup info scenario. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/recordings/test_cosmosdb_locations.yaml | Reverts locations recording to 2025-10-15 API version and associated payload. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py | Rolls back restore signature/behavior and Mongo role/user definition body handling. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/commands.py | Marks fleet-related command groups as preview. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/_transformers.py | Reverts transformer implementation for network rules/account output shaping. |
| src/azure-cli/azure/cli/command_modules/cosmosdb/_params.py | Removes restore argument disable_local_auth (rollback of CLI surface). |
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_backuprestore_scenario.py:538
- Similarly, mocking
knack.utilbased only onsys.modulespresence can shadow the realknack.utilmodule (and itsCLIError), impacting other tests in the same worker. Only inject a mock when import fails.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
9
to
13
| def transform_network_rule_json_output(result): | ||
| # 'result' is a plain dict produced by azure.cli.core.util.todict (which, unlike | ||
| # knack.util.todict, understands the typespec-generated SDK models). Rename the | ||
| # service endpoint flag to the historical CLI casing and drop the msrest-era | ||
| # 'additionalProperties' artifact if present. | ||
| result = todict(result) | ||
| result['ignoreMissingVnetServiceEndpoint'] = result.pop('ignoreMissingVNetServiceEndpoint', None) | ||
| result.pop('additionalProperties', None) | ||
| del result['additionalProperties'] | ||
| return result |
Comment on lines
439
to
443
| creation_timestamp_datetime = parser.parse(account_creation_time) | ||
| restore_ts = creation_timestamp_datetime + timedelta(minutes=61) | ||
| import time | ||
| # Cross region restore does not have a forced master backup during restore, so we need | ||
| # to wait one hour to get the master backup for a restore to be performed. This wait is | ||
| # only needed while recording against the live service; during playback the recorded | ||
| # cassette already reflects the post-wait state, so skip the sleep to keep CI fast. | ||
| if self.in_recording: | ||
| time.sleep(3662) | ||
| time.sleep(3662) | ||
| restore_ts_string = restore_ts.isoformat() |
Comment on lines
526
to
+530
| def setUp(self): | ||
| # Only mock dependencies that cannot actually be imported. Never replace a | ||
| # real, importable package in sys.modules: these unit tests share a | ||
| # long-lived xdist worker process, and leaving a MagicMock behind for | ||
| # e.g. 'azure.mgmt.cosmosdb.models' would poison every other test that | ||
| # later runs on the same worker (it would see "models is not a package"). | ||
| self._injected_mock_modules = [] | ||
|
|
||
| try: | ||
| import azure.mgmt.cosmosdb.models # noqa: F401 | ||
| except ImportError: | ||
| # Mock dependencies that might be missing or problematic to import | ||
| if 'azure.mgmt.cosmosdb.models' not in sys.modules: | ||
| sys.modules['azure.mgmt.cosmosdb.models'] = mock.MagicMock() | ||
| self._injected_mock_modules.append('azure.mgmt.cosmosdb.models') | ||
| try: | ||
| import azure.cli.core.util # noqa: F401 | ||
| except ImportError: | ||
| if 'azure.cli.core.util' not in sys.modules: |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
az cosmosdb: Add support for API version 2026-0…az cosmosdb: revert Add support for API version 2026-03-15(#33303)
Contributor
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
az cosmosdb: revert Add support for API version 2026-03-15(#33303)az cosmosdb: revert Add support for API version 2026-03-15(#33303)
az cosmosdb: revert Add support for API version 2026-03-15(#33303)az cosmosdb: Revert Add support for API version 2026-03-15(#33303)
Contributor
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
VeryEarly
approved these changes
Jul 28, 2026
yonzhan
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 PR Validation — ❌ Action needed
❌AzureCLI-BreakingChangeTest
Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:
…3-15 (#33303)"
This reverts commit 51bcb92.
Related command
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.