Skip to content

[dataprotection] Fix duplicate default retention rules for Azure Blob backup policies#9881

Open
IannGeorges wants to merge 3 commits into
Azure:mainfrom
IannGeorges:users/ianna/fixblobpol
Open

[dataprotection] Fix duplicate default retention rules for Azure Blob backup policies#9881
IannGeorges wants to merge 3 commits into
Azure:mainfrom
IannGeorges:users/ianna/fixblobpol

Conversation

@IannGeorges
Copy link
Copy Markdown
Member


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

ianna1-admin added 2 commits May 19, 2026 01:29
Copilot AI review requested due to automatic review settings May 19, 2026 06:58
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

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

Hi @IannGeorges,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@github-actions
Copy link
Copy Markdown
Contributor

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>

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 19, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

Hi @IannGeorges

⚠️ Release Requirements

Module: dataprotection

  • ⚠️ Please update VERSION to be 1.11.0 in src/dataprotection/setup.py

Notes

Copy link
Copy Markdown
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 updates the dataprotection extension’s AzureBlob backup policy manifest and policy-editing validation to eliminate the “duplicate Default retention rule” behavior and to enforce a clear mapping between default retention rule names and source datastores (VaultStore vs OperationalStore).

Changes:

  • Update the AzureBlob default policy template to ship only the VaultStore Default retention rule, and introduce a manifest mapping that reserves Default_OperationalStore for OperationalStore.
  • Add validation in backup-policy retention-rule set to prevent cross-store misuse of default rule names and enforce exclusive source store rules for AzureBlob.
  • Expand/adjust scenario tests and recordings to cover the new AzureBlob retention-rule behaviors and updated vault soft-delete defaults.

Reviewed changes

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

Show a summary per file
File Description
src/dataprotection/HISTORY.rst Updates changelog entry for the behavior change.
src/dataprotection/azext_dataprotection/manual/Manifests/AzureBlob.py Removes pre-seeded OperationalStore default rule; adds default rule mapping + exclusivity metadata.
src/dataprotection/azext_dataprotection/manual/helpers.py Adds validation helpers for default rule ↔ datastore mapping and exclusive source-store enforcement.
src/dataprotection/azext_dataprotection/manual/custom.py Wires new validations into retention-rule set logic and broadens “default rule” detection.
src/dataprotection/azext_dataprotection/manual/enums.py Adds Default_OperationalStore to allowed retention rule names.
src/dataprotection/azext_dataprotection/manual/_help.py Updates CLI help examples/descriptions (currently malformed; needs fixes).
src/dataprotection/azext_dataprotection/tests/latest/test_dataprotection_backup_policy.py Adds extensive AzureBlob retention-rule validation coverage; updates vault soft-delete state in tests.
src/dataprotection/azext_dataprotection/tests/latest/test_dataprotection_backup_instance_*.py Updates test constants/subscription handling and some locations/IDs.
src/dataprotection/azext_dataprotection/tests/latest/recordings/*.yaml Refreshes recordings to reflect new requests/responses and CLI/runtime versions.

Comment on lines +5 to +6
Upcoming Release
++++++++++++++++
@@ -112,14 +112,16 @@
helps['dataprotection backup-policy retention-rule set'] = """
type: command
short-summary: Add new retention rule or update existing retention rule.
@github-actions github-actions Bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 19, 2026
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 Data Protection release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants