Skip to content

Conversation

@dsapaliga
Copy link
Contributor

@dsapaliga dsapaliga commented Dec 30, 2025

Related command
az cosmosdb restore

Description
This is a simple fix for az cosmosdb restore command where we are enabling a new feature via a new parameter - source-backup-location. This feature is now being GA'd and was released in december in this PR - #32390, but had a bug that needed fixing.

Testing Guide
az cosmosdb restore -n "" -g "" -a "" --restore-timestamp 2023-08-10T07:16:21Z --source-backup-location "Central US EUAP" --location "Central US EUAP"

History Notes
[CosmosDB] az cosmosdb restore: Fix for cross region restore for cosmosdb


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 December 30, 2025 19:42
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Dec 30, 2025

❌AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
❌core
❌latest
❌3.12
Type Test Case Error Message Line
Failed test_help_loads The error message is too long, please check the pipeline log for details. src/azure-cli-core/azure/cli/core/tests/test_help.py:120
❌3.13
Type Test Case Error Message Line
Failed test_help_loads The error message is too long, please check the pipeline log for details. src/azure-cli-core/azure/cli/core/tests/test_help.py:120
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
❌network
❌latest
❌3.12
Type Test Case Error Message Line
Failed test_mariadb_private_link_scenario The error message is too long, please check the pipeline log for details. azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:649
Failed test_mysql_private_link_scenario The error message is too long, please check the pipeline log for details. azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:656
❌3.13
Type Test Case Error Message Line
Failed test_mariadb_private_link_scenario The error message is too long, please check the pipeline log for details. azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:649
Failed test_mysql_private_link_scenario The error message is too long, please check the pipeline log for details. azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:656
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
❌rdbms
❌latest
❌3.12
Type Test Case Error Message Line
Failed test_flexible_server_ssdv2_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:91
Failed test_flexible_server_ssdv2_restore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:106
Failed test_postgres_flexible_server_byok_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:116
Failed test_postgres_flexible_server_empty_rg_name The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:81
Failed test_postgres_flexible_server_georestore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:101
Failed test_postgres_flexible_server_ltr The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:111
Failed test_postgres_flexible_server_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:76
Failed test_postgres_flexible_server_mgmt_case_insensitive The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:86
Failed test_postgres_flexible_server_public_revivedropped_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:123
Failed test_postgres_flexible_server_restore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:96
Failed test_postgres_flexible_server_proxy_resource The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1014
Failed test_postgres_flexible_server_mgmt_update_validator The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1123
Failed test_postgres_flexible_server_auto_grow_replica_validator The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1263
Failed test_postgres_flexible_server_replica_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1257
Failed test_postgres_flexible_server_vnet_mgmt_supplied_subnet_id_in_different_rg The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1484
Failed test_postgres_flexible_server_vnet_mgmt_supplied_subnetid The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1473
Failed test_postgres_flexible_server_vnet_mgmt_supplied_vname_and_subnetname The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1479
Failed test_postgres_flexible_server_existing_private_dns_zone The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1879
Failed test_postgres_flexible_server_new_private_dns_zone The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1885
Failed test_postgres_flexible_server_upgrade_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2143
Failed test_postgres_flexible_server_backups_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2196
Failed test_postgresql_flexible_server_identity_microsoft_entra_admin_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2248
Failed test_postgresql_flexible_server_identity_microsoft_entra_admin_only_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2253
Failed test_postgres_flexible_server_advanced_threat_protection_setting_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2420
Failed test_postgres_flexible_server_logs_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2469
Failed test_postgres_flexible_server_private_endpoint_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2528
Failed test_postgres_flexible_server_fabric_mirroring_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2730
Failed test_elastic_clusters_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2784
Failed test_postgres_flexible_server_index_tuning_options The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2849
Failed test_postgres_flexible_server_autonomous_tuning_options The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2908
Failed test_postgres_flexible_server_migration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py:19
Failed test_postgres_flexible_server_onpremise_migration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py:23
❌3.13
Type Test Case Error Message Line
Failed test_flexible_server_ssdv2_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:91
Failed test_flexible_server_ssdv2_restore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:106
Failed test_postgres_flexible_server_byok_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:116
Failed test_postgres_flexible_server_empty_rg_name The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:81
Failed test_postgres_flexible_server_georestore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:101
Failed test_postgres_flexible_server_ltr The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:111
Failed test_postgres_flexible_server_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:76
Failed test_postgres_flexible_server_mgmt_case_insensitive The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:86
Failed test_postgres_flexible_server_public_revivedropped_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:123
Failed test_postgres_flexible_server_restore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:96
Failed test_postgres_flexible_server_proxy_resource The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1014
Failed test_postgres_flexible_server_mgmt_update_validator The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1123
Failed test_postgres_flexible_server_auto_grow_replica_validator The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1263
Failed test_postgres_flexible_server_replica_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1257
Failed test_postgres_flexible_server_vnet_mgmt_supplied_subnet_id_in_different_rg The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1484
Failed test_postgres_flexible_server_vnet_mgmt_supplied_subnetid The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1473
Failed test_postgres_flexible_server_vnet_mgmt_supplied_vname_and_subnetname The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1479
Failed test_postgres_flexible_server_existing_private_dns_zone The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1879
Failed test_postgres_flexible_server_new_private_dns_zone The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1885
Failed test_postgres_flexible_server_upgrade_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2143
Failed test_postgres_flexible_server_backups_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2196
Failed test_postgresql_flexible_server_identity_microsoft_entra_admin_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2248
Failed test_postgresql_flexible_server_identity_microsoft_entra_admin_only_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2253
Failed test_postgres_flexible_server_advanced_threat_protection_setting_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2420
Failed test_postgres_flexible_server_logs_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2469
Failed test_postgres_flexible_server_private_endpoint_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2528
Failed test_postgres_flexible_server_fabric_mirroring_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2730
Failed test_elastic_clusters_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2784
Failed test_postgres_flexible_server_index_tuning_options The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2849
Failed test_postgres_flexible_server_autonomous_tuning_options The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2908
Failed test_postgres_flexible_server_migration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py:19
Failed test_postgres_flexible_server_onpremise_migration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py:23
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link

Hi @dsapaliga,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Dec 30, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 30, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Contributor

Copilot AI left a comment

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 fixes the handling of the source_backup_location parameter for cross-region restore operations in CosmosDB. The parameter was incorrectly being set on DatabaseAccountCreateUpdateParameters instead of on the RestoreParameters object, and the feature is being moved out of preview status.

  • Moved source_backup_location from DatabaseAccountCreateUpdateParameters to RestoreParameters object
  • Removed the is_preview=True flag from the source_backup_location argument definition

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py Fixed bug by setting source_backup_location on restore_parameters object (lines 370-371) instead of on DatabaseAccountCreateUpdateParameters (removed from line 405)
src/azure-cli/azure/cli/command_modules/cosmosdb/_params.py Removed is_preview=True flag from source_backup_location argument, indicating the feature is now generally available

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

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 1, 2026

Please fix CI issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot CosmosDB az cosmosdb

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants