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
️✔️3.13
️✔️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
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️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

@dsapaliga
Copy link
Contributor Author

@yonzhan the errors in the CI seems to be specifically for the rdbms module, I am only editing a specific section under cosmosdb. Can you please point out why the CI shows errors for another module in my PR?

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

@evelyn-ys
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@dsapaliga dsapaliga changed the title [CosmosDB] az cosmosdb restore: fixes for cross region restore [CosmosDB] az cosmosdb restore: fixes for cross region restore Jan 5, 2026
@dsapaliga dsapaliga changed the title [CosmosDB] az cosmosdb restore: fixes for cross region restore [CosmosDB] az cosmosdb restore: Fixes for cross region restore Jan 5, 2026
@dsapaliga dsapaliga changed the title [CosmosDB] az cosmosdb restore: Fixes for cross region restore [CosmosDB] az cosmosdb restore: Fix for cross region restore Jan 5, 2026
@dsapaliga
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 32589 in repo Azure/azure-cli

c.argument('zonal_resiliency', arg_type=zonal_resiliency_arg_type, default="Disabled")
c.argument('allow_same_zone', arg_type=allow_same_zone_arg_type, default=False)
c.argument('database_name', arg_type=database_name_create_arg_type)
c.argument('database_name', arg_type=database_name_arg_type)
Copy link
Contributor

Choose a reason for hiding this comment

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

qq: why do we need this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were build/linter failures which was not moving ahead without this fix. I asked the CLI team about this they have asked me to fix it. If you see the previous commits, they have failed pipelines due to this.
I know its not our module, but I didnt see a choice.

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 5, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@vinhms
Copy link
Contributor

vinhms commented Jan 6, 2026

lgtm

Copy link
Contributor

@vinhms vinhms left a comment

Choose a reason for hiding this comment

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

lgtm

@evelyn-ys
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@dsapaliga dsapaliga changed the title [CosmosDB] az cosmosdb restore: Fix for cross region restore [CosmosDB] az cosmosdb restore: Cross region restore update Jan 6, 2026
@evelyn-ys evelyn-ys merged commit 0b8cfd6 into Azure:dev Jan 6, 2026
48 checks passed
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.

5 participants