Skip to content

Commit 0b8cfd6

Browse files
authored
[CosmosDB] az cosmosdb restore: Cross region restore update (#32589)
1 parent 6252d47 commit 0b8cfd6

File tree

5 files changed

+1750
-850
lines changed

5 files changed

+1750
-850
lines changed

src/azure-cli/azure/cli/command_modules/cosmosdb/_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def load_arguments(self, _):
442442
c.argument('default_identity', help="The primary identity to access key vault in CMK related features. e.g. 'FirstPartyIdentity', 'SystemAssignedIdentity' and more.")
443443
c.argument('public_network_access', options_list=['--public-network-access', '-p'], arg_type=get_enum_type(['ENABLED', 'DISABLED']), help="Sets public network access in server to either Enabled or Disabled.")
444444
c.argument('disable_ttl', options_list=['--disable-ttl', '-d'], arg_type=get_three_state_flag(), help="Enable or disable restoring with ttl disabled.")
445-
c.argument('source_backup_location', help="This is the location of the source account where backups are located. Provide this value if the source and target are in different locations.", is_preview=True)
445+
c.argument('source_backup_location', help="This is the location of the source account where backups are located. Provide this value if the source and target are in different locations.")
446446

447447
# Mongo role definition
448448
with self.argument_context('cosmosdb mongodb role definition') as c:

src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ def _create_database_account(client,
370370
if disable_ttl is not None:
371371
restore_parameters.restore_with_ttl_disabled = disable_ttl
372372

373+
if source_backup_location is not None:
374+
restore_parameters.source_backup_location = source_backup_location
375+
373376
params = DatabaseAccountCreateUpdateParameters(
374377
location=arm_location,
375378
locations=locations,
@@ -402,8 +405,7 @@ def _create_database_account(client,
402405
enable_per_region_per_partition_autoscale=enable_prpp_autoscale,
403406
minimal_tls_version=minimal_tls_version,
404407
enable_pbe=enable_pbe,
405-
default_priority_level=default_priority_level,
406-
source_backup_location=source_backup_location
408+
default_priority_level=default_priority_level
407409
)
408410

409411
async_docdb_create = client.begin_create_or_update(resource_group_name, account_name, params)

0 commit comments

Comments
 (0)