Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
text: az cosmosdb create --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup --subscription MySubscription
crafted: true
- name: Creates a new Azure Cosmos DB database account with two regions. UK South is zone redundant.
text: az cosmosdb create -n myaccount -g mygroup --locations regionName=eastus failoverPriority=0 isZoneRedundant=False --locations regionName=uksouth failoverPriority=1 isZoneRedundant=True --enable-multiple-write-locations
text: az cosmosdb create -n myaccount -g mygroup --locations regionName=eastus failoverPriority=0 isZoneRedundant=False --locations regionName=uksouth failoverPriority=1 isZoneRedundant=True --enable-multiple-write-locations --network-acl-bypass AzureServices --network-acl-bypass-resource-ids /subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Synapse/workspaces/wsName
"""

helps['cosmosdb database'] = """
Expand Down Expand Up @@ -848,5 +848,5 @@
text: az cosmosdb update --capabilities EnableGremlin --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup
crafted: true
- name: Creates a new Azure Cosmos DB database account with two regions. UK South is zone redundant.
text: az cosmosdb update -n myaccount -g mygroup --locations regionName=eastus failoverPriority=0 isZoneRedundant=False --locations regionName=uksouth failoverPriority=1 isZoneRedundant=True --enable-multiple-write-locations
text: az cosmosdb update -n myaccount -g mygroup --locations regionName=eastus failoverPriority=0 isZoneRedundant=False --locations regionName=uksouth failoverPriority=1 isZoneRedundant=True --enable-multiple-write-locations --network-acl-bypass AzureServices --network-acl-bypass-resource-ids /subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Synapse/workspaces/wsName
"""
2 changes: 2 additions & 0 deletions src/azure-cli/azure/cli/command_modules/cosmosdb/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def load_arguments(self, _):
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('enable_public_network', options_list=['--enable-public-network', '-e'], arg_type=get_three_state_flag(), help="Enable or disable public network access to server.")
c.argument('enable_analytical_storage', arg_type=get_three_state_flag(), help="Flag to enable log storage on the account.", is_preview=True)
c.argument('network_acl_bypass', options_list=['--network-acl-bypass'], help="Flag to enable or disable Network Acl Bypass.")
c.argument('network_acl_bypass_resource_ids', nargs='+', options_list=['--network-acl-bypass-resource-ids'], help="List of Resource Ids to allow Network Acl Bypass.")

for scope in ['cosmosdb regenerate-key', 'cosmosdb keys regenerate']:
with self.argument_context(scope) as c:
Expand Down
16 changes: 12 additions & 4 deletions src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def cli_cosmosdb_create(cmd, client,
enable_public_network=None,
enable_analytical_storage=None,
enable_free_tier=None,
server_version=None):
server_version=None,
network_acl_bypass=None,
network_acl_bypass_resource_ids=None):
"""Create a new Azure Cosmos DB database account."""
consistency_policy = None
if default_consistency_level is not None:
Expand Down Expand Up @@ -139,7 +141,9 @@ def cli_cosmosdb_create(cmd, client,
public_network_access=public_network_access,
api_properties=api_properties,
enable_analytical_storage=enable_analytical_storage,
enable_free_tier=enable_free_tier)
enable_free_tier=enable_free_tier,
network_acl_bypass=network_acl_bypass,
network_acl_bypass_resource_ids=network_acl_bypass_resource_ids)

async_docdb_create = client.create_or_update(resource_group_name, account_name, params)
docdb_account = async_docdb_create.result()
Expand All @@ -164,7 +168,9 @@ def cli_cosmosdb_update(client,
enable_multiple_write_locations=None,
disable_key_based_metadata_write_access=None,
enable_public_network=None,
enable_analytical_storage=None):
enable_analytical_storage=None,
network_acl_bypass=None,
network_acl_bypass_resource_ids=None):
"""Update an existing Azure Cosmos DB database account. """
existing = client.get(resource_group_name, account_name)

Expand Down Expand Up @@ -205,7 +211,9 @@ def cli_cosmosdb_update(client,
enable_multiple_write_locations=enable_multiple_write_locations,
disable_key_based_metadata_write_access=disable_key_based_metadata_write_access,
public_network_access=public_network_access,
enable_analytical_storage=enable_analytical_storage)
enable_analytical_storage=enable_analytical_storage,
network_acl_bypass=network_acl_bypass,
network_acl_bypass_resource_ids=network_acl_bypass_resource_ids)

async_docdb_update = client.update(resource_group_name, account_name, params)
docdb_account = async_docdb_update.result()
Expand Down
Loading