Skip to content

PS cosmos db restore command: Skipping client side restore validation check #28171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

dsapaliga
Copy link

@dsapaliga dsapaliga commented Jul 10, 2025

Description

This is a simple fix to remove the validation check for restorable accounts when the customer uses the powershell restore command. Couple of reason for removing this:

  • Due to the mismatch in location format given as input vs how we validate the permissions.
  • Avoid timeout during this validation check for large account restores.

This change is already part of cli-preview, updating this for powershell stable now.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@Copilot Copilot AI review requested due to automatic review settings July 10, 2025 22:17
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

@Copilot 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 removes client-side validation checks for restorable accounts in the PowerShell Cosmos DB restore command to address location format mismatches and prevent timeouts during large account restores.

  • Removes the validation logic that checks if source accounts contain restorable resources for live accounts
  • Eliminates the isSourceRestorableAccountDeleted variable and related conditional logic
  • Streamlines the restore process by bypassing client-side validation that was causing issues

@dsapaliga
Copy link
Author

Question for powershell team reviewers, how do i upgrade the version of this change? so, the customer would know which version to update to for this change to take efffect.

@YanaXu
Copy link
Contributor

YanaXu commented Jul 11, 2025

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@YanaXu
Copy link
Contributor

YanaXu commented Jul 11, 2025

Question for powershell team reviewers, how do i upgrade the version of this change? so, the customer would know which version to update to for this change to take efffect.

Hi @dsapaliga, please update the changelog or the change will not be released.

@YanaXu
Copy link
Contributor

YanaXu commented Jul 11, 2025

The tests of this source code are skipped. Could you please test them and provide the test result?

@YanaXu YanaXu self-assigned this Jul 11, 2025
@dsapaliga
Copy link
Author

The tests of this source code are skipped. Could you please test them and provide the test result?

I have not found any reference to the DateTime.ToString(), my changes currently remove that section of code entirely, I have remove the skip from tests.

@dsapaliga dsapaliga closed this Jul 17, 2025
@dsapaliga dsapaliga reopened this Jul 17, 2025
@dsapaliga
Copy link
Author

@dsapaliga please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree company="Microsoft"

@dsapaliga
Copy link
Author

Question for powershell team reviewers, how do i upgrade the version of this change? so, the customer would know which version to update to for this change to take efffect.

Hi @dsapaliga, please update the changelog or the change will not be released.

Updated the changelog, please validate if it looks good, thank you.

@YanaXu
Copy link
Contributor

YanaXu commented Jul 18, 2025

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@YanaXu
Copy link
Contributor

YanaXu commented Jul 18, 2025

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@dsapaliga
Copy link
Author

/azp run

Copy link
Contributor

Commenter does not have sufficient privileges for PR 28171 in repo Azure/azure-powershell

@YanaXu
Copy link
Contributor

YanaXu commented Jul 21, 2025

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@YanaXu
Copy link
Contributor

YanaXu commented Jul 21, 2025

Hi @dsapaliga, let's handle the "skip" tests later. For this PR, please provide a screenshot of test, just let us know the result is OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants