Skip to content

{Cosmos DB} az cosmosdb: Revert Add support for API version 2026-03-15(#33303) - #33802

Merged
VeryEarly merged 1 commit into
Azure:devfrom
pjohari-ms:dev
Jul 28, 2026
Merged

{Cosmos DB} az cosmosdb: Revert Add support for API version 2026-03-15(#33303)#33802
VeryEarly merged 1 commit into
Azure:devfrom
pjohari-ms:dev

Conversation

@pjohari-ms

@pjohari-ms pjohari-ms commented Jul 28, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ❌ Action needed

Breaking Changes Tests
❌ 1 ️✔️ 130/130
❌AzureCLI-BreakingChangeTest
❌cosmosdb
rule cmd_name rule_message suggest_message
1007 - ParaRemove cosmosdb restore cmd cosmosdb restore removed parameter disable_local_auth please add back parameter disable_local_auth for cmd cosmosdb restore
⚠️ 1003 - CmdPropAdd cosmosdb fleet create cmd cosmosdb fleet create added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleet delete cmd cosmosdb fleet delete added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleet list cmd cosmosdb fleet list added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleet show cmd cosmosdb fleet show added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleetspace account create cmd cosmosdb fleetspace account create added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleetspace account delete cmd cosmosdb fleetspace account delete added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleetspace account list cmd cosmosdb fleetspace account list added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleetspace account show cmd cosmosdb fleetspace account show added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleetspace create cmd cosmosdb fleetspace create added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleetspace delete cmd cosmosdb fleetspace delete added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleetspace list cmd cosmosdb fleetspace list added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleetspace show cmd cosmosdb fleetspace show added property is_preview
⚠️ 1003 - CmdPropAdd cosmosdb fleetspace update cmd cosmosdb fleetspace update added property is_preview

Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:

  • Breaking changes can only be merged during the designated breaking change window
  • A pre-announcement must be released at least one month in advance

For more details on how to introduce breaking changes, refer to the documentation: azure-cli/doc/how_to_introduce_breaking_changes.md

…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 feature


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

Copilot AI review requested due to automatic review settings July 28, 2026 04:05
@pjohari-ms
pjohari-ms requested review from a team as code owners July 28, 2026 04:05
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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.

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-cosmosdb from 10.0.0 to 9.9.0 across 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.util based only on sys.modules presence can shadow the real knack.util module (and its CLIError), 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:
@a0x1ab

a0x1ab commented Jul 28, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@VeryEarly VeryEarly changed the title Revert "[Cosmos DB] az cosmosdb: Add support for API version 2026-0… [Cosmos DB] az cosmosdb: revert Add support for API version 2026-03-15(#33303) Jul 28, 2026
@VeryEarly

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@VeryEarly VeryEarly changed the title [Cosmos DB] az cosmosdb: revert Add support for API version 2026-03-15(#33303) {Cosmos DB} az cosmosdb: revert Add support for API version 2026-03-15(#33303) Jul 28, 2026
@VeryEarly VeryEarly changed the title {Cosmos DB} az cosmosdb: revert Add support for API version 2026-03-15(#33303) {Cosmos DB} az cosmosdb: Revert Add support for API version 2026-03-15(#33303) Jul 28, 2026
@VeryEarly

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@VeryEarly
VeryEarly merged commit 818b0d2 into Azure:dev Jul 28, 2026
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants