Skip to content

{Cosmos DB} Reclaim the documentdb command namespace#33686

Merged
VeryEarly merged 1 commit into
Azure:devfrom
amatarritamicrosoft:users/amatarrita/unblock-documentdb
Jul 6, 2026
Merged

{Cosmos DB} Reclaim the documentdb command namespace#33686
VeryEarly merged 1 commit into
Azure:devfrom
amatarritamicrosoft:users/amatarrita/unblock-documentdb

Conversation

@amatarritamicrosoft

Copy link
Copy Markdown
Member

Summary

Reclaim the documentdb command namespace by removing the _documentdb_deprecate guard from the cosmosdb command module (src/azure-cli/azure/cli/command_modules/cosmosdb/__init__.py).

Background

Microsoft.DocumentDB was the original resource provider name for what is now Cosmos DB. Years ago the CLI renamed az documentdb to az cosmosdb and added a guard that raises All documentdb commands have been renamed to cosmosdb on every az documentdb ... invocation (registered on EVENT_INVOKER_PRE_PARSE_ARGS, before argument parsing).

That guidance is now stale. The documentdb namespace is required for the new DocumentDB (Microsoft.DocumentDB/mongoClusters) service. Because the guard fires before parsing, even a brand-new provider of az documentdb commands is rejected until it is removed.

Change

  • Remove the _documentdb_deprecate function.
  • Remove its cli_ctx.register_event(EVENT_INVOKER_PRE_PARSE_ARGS, ...) registration.
  • Remove the now-unused from knack.events import EVENT_INVOKER_PRE_PARSE_ARGS import.

Impact

  • az documentdb is no longer blocked (the namespace is free for the new service).
  • az cosmosdb is unaffected — verified az cosmosdb still loads and az cosmosdb create works end-to-end.
  • No tests referenced the guard; the guard was the only usage in the repo.

/cc @necusjz

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Remove the `_documentdb_deprecate` guard (and its EVENT_INVOKER_PRE_PARSE_ARGS
registration and now-unused import) from the cosmosdb command module.

The guard was added years ago when `az documentdb` was renamed to
`az cosmosdb`; it raises `All documentdb commands have been renamed to
cosmosdb` on every `az documentdb ...` invocation, before argument parsing.
That guidance is now stale: the `documentdb` namespace is needed for the new
DocumentDB (Microsoft.DocumentDB/mongoClusters) service. `az cosmosdb` is
unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 06:57
@amatarritamicrosoft amatarritamicrosoft requested a review from a team as a code owner July 1, 2026 06:57
@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jul 1, 2026

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.14
️✔️acs
️✔️latest
️✔️3.12
️✔️3.14
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.14
️✔️ams
️✔️latest
️✔️3.12
️✔️3.14
️✔️apim
️✔️latest
️✔️3.12
️✔️3.14
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.14
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️aro
️✔️latest
️✔️3.12
️✔️3.14
️✔️backup
️✔️latest
️✔️3.12
️✔️3.14
️✔️batch
️✔️latest
️✔️3.12
️✔️3.14
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.14
️✔️billing
️✔️latest
️✔️3.12
️✔️3.14
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.14
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.14
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.14
️✔️config
️✔️latest
️✔️3.12
️✔️3.14
️✔️configure
️✔️latest
️✔️3.12
️✔️3.14
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.14
️✔️container
️✔️latest
️✔️3.12
️✔️3.14
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.14
️✔️core
️✔️latest
️✔️3.12
️✔️3.14
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.14
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.14
️✔️dls
️✔️latest
️✔️3.12
️✔️3.14
️✔️dms
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.14
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.14
️✔️find
️✔️latest
️✔️3.12
️✔️3.14
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.14
️✔️identity
️✔️latest
️✔️3.12
️✔️3.14
️✔️iot
️✔️latest
️✔️3.12
️✔️3.14
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.14
️✔️lab
️✔️latest
️✔️3.12
️✔️3.14
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️maps
️✔️latest
️✔️3.12
️✔️3.14
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.14
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.14
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.14
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.14
️✔️network
️✔️latest
️✔️3.12
️✔️3.14
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.14
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.14
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.14
️✔️profile
️✔️latest
️✔️3.12
️✔️3.14
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.14
️✔️redis
️✔️latest
️✔️3.12
️✔️3.14
️✔️relay
️✔️latest
️✔️3.12
️✔️3.14
️✔️resource
️✔️latest
️✔️3.12
️✔️3.14
️✔️role
️✔️latest
️✔️3.12
️✔️3.14
️✔️search
️✔️latest
️✔️3.12
️✔️3.14
️✔️security
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.14
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.14
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.14
️✔️sql
️✔️latest
️✔️3.12
️✔️3.14
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.14
️✔️storage
️✔️latest
️✔️3.12
️✔️3.14
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.14
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.14
️✔️util
️✔️latest
️✔️3.12
️✔️3.14
️✔️vm
️✔️latest
️✔️3.12
️✔️3.14

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jul 1, 2026

Copy link
Copy Markdown
❌AzureCLI-BreakingChangeTest
❌network
rule cmd_name rule_message suggest_message
1007 - ParaRemove network nat gateway create cmd network nat gateway create removed parameter nat64 please add back parameter nat64 for cmd network nat gateway create
1007 - ParaRemove network nat gateway update cmd network nat gateway update removed parameter nat64 please add back parameter nat64 for cmd network nat gateway update

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

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

Removes the legacy pre-parse deprecation guard in the cosmosdb command module that previously blocked any az documentdb ... invocation, freeing the documentdb namespace for the new DocumentDB (Microsoft.DocumentDB/mongoClusters) service while leaving az cosmosdb behavior unchanged.

Changes:

  • Removed the _documentdb_deprecate pre-parse handler.
  • Removed the EVENT_INVOKER_PRE_PARSE_ARGS event registration and its import.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@amatarritamicrosoft amatarritamicrosoft marked this pull request as draft July 1, 2026 07:01
@yonzhan

yonzhan commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

CosmosDB

@necusjz

necusjz commented Jul 2, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

@necusjz necusjz changed the title [CosmosDB] Reclaim the documentdb command namespace {Cosmos DB} Reclaim the documentdb command namespace Jul 6, 2026
@necusjz necusjz marked this pull request as ready for review July 6, 2026 03:53
@VeryEarly VeryEarly merged commit 5e868cf into Azure:dev Jul 6, 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.

6 participants