Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def load_arguments(self, _):
c.argument('virtual_network_rules', nargs='+', validator=validate_virtual_network_rules, help='ACL\'s for virtual network')
c.argument('enable_multiple_write_locations', arg_type=get_three_state_flag(), help="Enable Multiple Write Locations")
c.argument('disable_key_based_metadata_write_access', arg_type=get_three_state_flag(), help="Disable write operations on metadata resources (databases, containers, throughput) via account keys")
c.argument('disable_local_auth', arg_type=get_three_state_flag(), help="Disable key-based authentication on the Cosmos DB account")
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The new --disable-local-auth parameter lacks test coverage. Similar parameters like --disable-key-based-metadata-write-access have test coverage in test_cosmosdb_commands.py (see line 64). Consider adding tests that verify the parameter works correctly with both cosmosdb create and cosmosdb update commands, similar to the pattern used for other boolean flags in the test suite.

Copilot uses AI. Check for mistakes.
c.argument('public_network_access', options_list=['--public-network-access', '-p'], arg_type=get_enum_type(['ENABLED', 'DISABLED', 'SECUREDBYPERIMETER']), help="Sets public network access in server to either Enabled, Disabled, or SecuredByPerimeter.")
c.argument('enable_analytical_storage', arg_type=get_three_state_flag(), help="Flag to enable log storage on the account.")
c.argument('network_acl_bypass', arg_type=get_enum_type(NetworkAclBypass), options_list=['--network-acl-bypass'], help="Flag to enable or disable Network Acl Bypass.")
Expand Down
6 changes: 6 additions & 0 deletions src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def cli_cosmosdb_create(cmd,
virtual_network_rules=None,
enable_multiple_write_locations=None,
disable_key_based_metadata_write_access=None,
disable_local_auth=None,
key_uri=None,
public_network_access=None,
enable_analytical_storage=None,
Expand Down Expand Up @@ -181,6 +182,7 @@ def cli_cosmosdb_create(cmd,
virtual_network_rules=virtual_network_rules,
enable_multiple_write_locations=enable_multiple_write_locations,
disable_key_based_metadata_write_access=disable_key_based_metadata_write_access,
disable_local_auth=disable_local_auth,
key_uri=key_uri,
public_network_access=public_network_access,
enable_analytical_storage=enable_analytical_storage,
Expand Down Expand Up @@ -229,6 +231,7 @@ def _create_database_account(client,
virtual_network_rules=None,
enable_multiple_write_locations=None,
disable_key_based_metadata_write_access=None,
disable_local_auth=None,
key_uri=None,
public_network_access=None,
enable_analytical_storage=None,
Expand Down Expand Up @@ -380,6 +383,7 @@ def _create_database_account(client,
virtual_network_rules=virtual_network_rules,
enable_multiple_write_locations=enable_multiple_write_locations,
disable_key_based_metadata_write_access=disable_key_based_metadata_write_access,
disable_local_auth=disable_local_auth,
key_vault_key_uri=key_uri,
public_network_access=public_network_access,
api_properties=api_properties,
Expand Down Expand Up @@ -424,6 +428,7 @@ def cli_cosmosdb_update(client,
virtual_network_rules=None,
enable_multiple_write_locations=None,
disable_key_based_metadata_write_access=None,
disable_local_auth=None,
key_uri=None,
public_network_access=None,
enable_analytical_storage=None,
Expand Down Expand Up @@ -528,6 +533,7 @@ def cli_cosmosdb_update(client,
virtual_network_rules=virtual_network_rules,
enable_multiple_write_locations=enable_multiple_write_locations,
disable_key_based_metadata_write_access=disable_key_based_metadata_write_access,
disable_local_auth=disable_local_auth,
key_vault_key_uri=key_uri,
public_network_access=public_network_access,
enable_analytical_storage=enable_analytical_storage,
Expand Down
Loading