From eaf1ae004603046e09216484b591eae06bdaf1b1 Mon Sep 17 00:00:00 2001 From: ianna1-admin Date: Wed, 20 May 2026 04:04:35 -0500 Subject: [PATCH 1/3] improve docs, help, example to reflect new changes --- ...tectionPolicyRetentionRuleClientObject.ps1 | 6 ++-- ...otectionPolicyRetentionRuleClientObject.md | 34 ++++++++++++++++--- .../docs/New-AzDataProtectionBackupPolicy.md | 29 +++------------- ...otectionPolicyRetentionRuleClientObject.md | 4 +-- ...otectionPolicyRetentionRuleClientObject.md | 31 +++++++++++++++-- .../help/New-AzDataProtectionBackupPolicy.md | 29 +++------------- 6 files changed, 71 insertions(+), 62 deletions(-) diff --git a/src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1 b/src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1 index 8fb6e271e96b..69863df713fa 100644 --- a/src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1 +++ b/src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1 @@ -17,8 +17,8 @@ function Edit-AzDataProtectionPolicyRetentionRuleClientObject { [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IBackupPolicy] ${Policy}, - [Parameter(ParameterSetName='AddRetention',Mandatory, HelpMessage='Retention Rule Name. Note: Default_OperationalStore is applicable to AzureBlob only and is reserved for OperationalStore lifecycles; on AzureBlob, -Name Default is reserved for VaultStore lifecycles.')] - [Parameter(ParameterSetName='RemoveRetention',Mandatory, HelpMessage='Retention Rule Name. Note: Default and Default_OperationalStore are default retention rules and cannot be removed.')] + [Parameter(ParameterSetName='AddRetention',Mandatory, HelpMessage='Retention Rule Name.')] + [Parameter(ParameterSetName='RemoveRetention',Mandatory, HelpMessage='Retention Rule Name. Note: Default retention rules cannot be removed.')] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.RetentionRuleName] ${Name}, @@ -30,7 +30,7 @@ function Edit-AzDataProtectionPolicyRetentionRuleClientObject { [System.Management.Automation.SwitchParameter] ${RemoveRule}, - [Parameter(ParameterSetName='AddRetention',Mandatory=$false, HelpMessage='Specifies whether to modify an existing LifeCycle.')] + [Parameter(ParameterSetName='AddRetention',Mandatory=$false, HelpMessage='[Deprecated] Specifies whether to modify an existing LifeCycle. Will be removed in a future release; duplicate retention rules are no longer permitted.')] [Nullable[System.Boolean]] ${OverwriteLifeCycle}, diff --git a/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md b/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md index ce940830ef1f..b94b24932693 100644 --- a/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md +++ b/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Edit-AzDataProtectionPolicyRetentionRuleClientObject ## SYNOPSIS -Adds or removes Retention Rule to existing Policy +Adds or removes Retention Rule to an existing backup policy. ## SYNTAX @@ -25,7 +25,8 @@ Edit-AzDataProtectionPolicyRetentionRuleClientObject -IsDefault -LifeC ``` ## DESCRIPTION -Adds or removes Retention Rule to existing Policy +Adds or removes Retention Rule to an existing backup policy. +Adding a retention rule whose `-Name` already exists on the policy is rejected unless `-OverwriteLifeCycle $true` is supplied. ## EXAMPLES @@ -59,6 +60,23 @@ DatasourceType ObjectType This command removes weekly retention rule if it exists in given backup policy. +### Example 3: Add an OperationalStore retention rule to an AzureBlob policy +```powershell +$pol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureBlob +$opLifecycle = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30 +Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Default_OperationalStore -LifeCycles $opLifecycle -IsDefault $true +``` + +```output +DatasourceType ObjectType +-------------- ---------- +{Microsoft.Storage/storageAccounts/blobServices} BackupPolicy +``` + +For AzureBlob, OperationalStore retention rules **must** be named `Default_OperationalStore`. The rule is added additively — the existing `Default` (VaultStore) retention rule on the policy template is preserved. Passing `-Name Default` with an OperationalStore lifecycle is rejected by validation. + +Note: `-OverwriteLifeCycle` is deprecated and will be removed in a future release; duplicate retention rules are no longer permitted. + ## PARAMETERS ### -IsDefault @@ -92,12 +110,14 @@ Accept wildcard characters: False ``` ### -Name -Retention Rule Name +Retention Rule Name. +Note: Default retention rules cannot be removed. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.RetentionRuleName Parameter Sets: (All) Aliases: +Accepted values: Default, Daily, Weekly, Monthly, Yearly, Default_OperationalStore Required: True Position: Named @@ -107,7 +127,7 @@ Accept wildcard characters: False ``` ### -OverwriteLifeCycle -Specifies whether to modify an existing LifeCycle. +[Deprecated] Specifies whether to modify an existing LifeCycle. Will be removed in a future release; duplicate retention rules are no longer permitted. ```yaml Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] @@ -162,5 +182,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES +### Validation rules + +* **Duplicate retention rules are rejected.** Adding a rule whose `-Name` already exists on the policy throws `Retention rule '' already exists. Use -OverwriteLifeCycle $true to update it.` Pass `-OverwriteLifeCycle $true` to replace the existing rule's lifecycles in place. +* **Default rule removal.** `-Name Default` cannot be removed via `-RemoveRule`; the cmdlet throws `Removing Default Retention Rule is not allowed. Please try again with different rule name.` +* **`-OverwriteLifeCycle` is deprecated** and will be removed in a future release; duplicate retention rules are no longer permitted. + ## RELATED LINKS diff --git a/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupPolicy.md b/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupPolicy.md index 5fba02f1df4a..4d98da99db06 100644 --- a/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupPolicy.md +++ b/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupPolicy.md @@ -112,28 +112,6 @@ The seventh, eight commands update the policy object with lifecycles created. Next we create FirstOfDay, FirstOfWeek tag criteria and update the policy. The last command creates the policy. -### Example 4: Create a operational policy for AzureBlob -```powershell -$defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureBlob -Edit-AzDataProtectionPolicyTriggerClientObject -Policy $defaultPol -RemoveSchedule -$lifeCycleOperationalTier = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30 -Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default -LifeCycles $lifeCycleOperationalTier -IsDefault $true -OverwriteLifeCycle $true -$opPolicy = New-AzDataProtectionBackupPolicy -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -Name "operationalPolicyName" -Policy $defaultPol -``` - -```output -Name Type ----- ---- -operationalPolicyName Microsoft.DataProtection/backupVaults/backupPolicies -``` - -The first command gets the default policy template for AzureBlob. -Policy template is by default vaulted policy. -The second command removes the vaulted policy schedule since we are creating operational policy. -The third command creates a operational store lifecycle for 30 Days. -The fourth command overwrites the vault lifecycle with operational store lifecycle. -The last command creates the operational store policy. - ### Example 4: Create a vaulted policy for AzureBlob ```powershell $defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureBlob @@ -160,7 +138,7 @@ The last command creates the vault store policy. ```powershell $defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureBlob $lifeCycleOperationalTier = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30 -Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default -LifeCycles $lifeCycleOperationalTier -IsDefault $true -OverwriteLifeCycle $false +Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default_OperationalStore -LifeCycles $lifeCycleOperationalTier -IsDefault $true $lifeCycleVaultTierWeekly = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 7 Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Weekly -LifeCycles $lifeCycleVaultTierWeekly -IsDefault $false $tagCriteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfWeek @@ -188,8 +166,9 @@ Name Type operationalVaultedPolicyName Microsoft.DataProtection/backupVaults/backupPolicies ``` -The first command gets the default vaulted policy template for AzureBlob. -The second to fifteenth command defines and updates the Operational, vaulted weekly, monthly, yearly lifecycle and tagcriteria. +The first command gets the default vaulted policy template for AzureBlob. The template ships with a `Default` (Vault) retention rule. +The second and third commands add an OperationalStore retention rule named `Default_OperationalStore` to the policy. This is **additive** — the existing `Default` Vault rule is preserved. +The fourth through fifteenth commands define and update the vaulted weekly, monthly, yearly lifecycles and tag criteria. Next we define a trigger object with schedule time and timezone, set it to 2:30 AM West Europe standard time. The last command creates the hybrid AzureBlob policy. diff --git a/src/DataProtection/DataProtection.Autorest/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md b/src/DataProtection/DataProtection.Autorest/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md index d9fc8e62d3e2..3853e5fd0e7b 100644 --- a/src/DataProtection/DataProtection.Autorest/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md +++ b/src/DataProtection/DataProtection.Autorest/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md @@ -39,7 +39,7 @@ DatasourceType ObjectType {Microsoft.Storage/storageAccounts/blobServices} BackupPolicy ``` -For AzureBlob, OperationalStore retention rules **must** be named `Default_OperationalStore`. The rule is added additively — the existing `Default` (Vault) retention rule on the policy template is preserved. +For AzureBlob, OperationalStore retention rules **must** be named `Default_OperationalStore`. The rule is added additively — the existing `Default` (VaultStore) retention rule on the policy template is preserved. Passing `-Name Default` with an OperationalStore lifecycle is rejected by validation. -Note: passing `-Name Default` with an OperationalStore lifecycle now errors out (it was previously the buggy `-OverwriteLifeCycle $true`/`$false` patterns that produced a duplicate-`Default` rule). +Note: `-OverwriteLifeCycle` is deprecated and will be removed in a future release; duplicate retention rules are no longer permitted. diff --git a/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md b/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md index 21324bdbabbc..e5dbf0fdeadc 100644 --- a/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md +++ b/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Edit-AzDataProtectionPolicyRetentionRuleClientObject ## SYNOPSIS -Adds or removes Retention Rule to existing Policy +Adds or removes Retention Rule to an existing backup policy. ## SYNTAX @@ -26,7 +26,8 @@ Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy -Na ``` ## DESCRIPTION -Adds or removes Retention Rule to existing Policy +Adds or removes Retention Rule to an existing backup policy. +Adding a retention rule whose `-Name` already exists on the policy is rejected unless `-OverwriteLifeCycle $true` is supplied. ## EXAMPLES @@ -60,6 +61,23 @@ DatasourceType ObjectType This command removes weekly retention rule if it exists in given backup policy. +### Example 3: Add an OperationalStore retention rule to an AzureBlob policy +```powershell +$pol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureBlob +$opLifecycle = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30 +Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Default_OperationalStore -LifeCycles $opLifecycle -IsDefault $true +``` + +```output +DatasourceType ObjectType +-------------- ---------- +{Microsoft.Storage/storageAccounts/blobServices} BackupPolicy +``` + +For AzureBlob, OperationalStore retention rules **must** be named `Default_OperationalStore`. The rule is added additively — the existing `Default` (VaultStore) retention rule on the policy template is preserved. Passing `-Name Default` with an OperationalStore lifecycle is rejected by validation. + +Note: `-OverwriteLifeCycle` is deprecated and will be removed in a future release; duplicate retention rules are no longer permitted. + ## PARAMETERS ### -IsDefault @@ -109,7 +127,7 @@ Accept wildcard characters: False ``` ### -OverwriteLifeCycle -Specifies whether to modify an existing LifeCycle. +[Deprecated] Specifies whether to modify an existing LifeCycle. Will be removed in a future release; duplicate retention rules are no longer permitted. ```yaml Type: System.Nullable`1[System.Boolean] @@ -164,4 +182,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES +### Validation rules + +* **Duplicate retention rules are rejected.** Adding a rule whose `-Name` already exists on the policy throws `Retention rule '' already exists. Use -OverwriteLifeCycle $true to update it.` Pass `-OverwriteLifeCycle $true` to replace the existing rule's lifecycles in place. +* **Default rule removal.** `-Name Default` cannot be removed via `-RemoveRule`; the cmdlet throws `Removing Default Retention Rule is not allowed. Please try again with different rule name.` +* **`-OverwriteLifeCycle` is deprecated** and will be removed in a future release; duplicate retention rules are no longer permitted. + + ## RELATED LINKS diff --git a/src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md b/src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md index ee91f55573c9..f4081f2cdc93 100644 --- a/src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md +++ b/src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md @@ -112,28 +112,6 @@ The seventh, eight commands update the policy object with lifecycles created. Next we create FirstOfDay, FirstOfWeek tag criteria and update the policy. The last command creates the policy. -### Example 4: Create a operational policy for AzureBlob -```powershell -$defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureBlob -Edit-AzDataProtectionPolicyTriggerClientObject -Policy $defaultPol -RemoveSchedule -$lifeCycleOperationalTier = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30 -Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default -LifeCycles $lifeCycleOperationalTier -IsDefault $true -OverwriteLifeCycle $true -$opPolicy = New-AzDataProtectionBackupPolicy -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -Name "operationalPolicyName" -Policy $defaultPol -``` - -```output -Name Type ----- ---- -operationalPolicyName Microsoft.DataProtection/backupVaults/backupPolicies -``` - -The first command gets the default policy template for AzureBlob. -Policy template is by default vaulted policy. -The second command removes the vaulted policy schedule since we are creating operational policy. -The third command creates a operational store lifecycle for 30 Days. -The fourth command overwrites the vault lifecycle with operational store lifecycle. -The last command creates the operational store policy. - ### Example 4: Create a vaulted policy for AzureBlob ```powershell $defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureBlob @@ -160,7 +138,7 @@ The last command creates the vault store policy. ```powershell $defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureBlob $lifeCycleOperationalTier = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30 -Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default -LifeCycles $lifeCycleOperationalTier -IsDefault $true -OverwriteLifeCycle $false +Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default_OperationalStore -LifeCycles $lifeCycleOperationalTier -IsDefault $true $lifeCycleVaultTierWeekly = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 7 Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Weekly -LifeCycles $lifeCycleVaultTierWeekly -IsDefault $false $tagCriteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfWeek @@ -188,8 +166,9 @@ Name Type operationalVaultedPolicyName Microsoft.DataProtection/backupVaults/backupPolicies ``` -The first command gets the default vaulted policy template for AzureBlob. -The second to fifteenth command defines and updates the Operational, vaulted weekly, monthly, yearly lifecycle and tagcriteria. +The first command gets the default vaulted policy template for AzureBlob. The template ships with a `Default` (Vault) retention rule. +The second and third commands add an OperationalStore retention rule named `Default_OperationalStore` to the policy. This is **additive** — the existing `Default` Vault rule is preserved. +The fourth through fifteenth commands define and update the vaulted weekly, monthly, yearly lifecycles and tag criteria. Next we define a trigger object with schedule time and timezone, set it to 2:30 AM West Europe standard time. The last command creates the hybrid AzureBlob policy. From c09c7bad593bafdac65363cdbb3f520edc0a6ffa Mon Sep 17 00:00:00 2001 From: ianna1-admin Date: Wed, 20 May 2026 07:49:02 -0500 Subject: [PATCH 2/3] address copilot comments --- ...ataProtectionPolicyRetentionRuleClientObject.ps1 | 4 ++-- ...DataProtectionPolicyRetentionRuleClientObject.md | 12 +++++------- .../docs/New-AzDataProtectionBackupPolicy.md | 4 ++-- ...DataProtectionPolicyRetentionRuleClientObject.md | 2 +- ...DataProtectionPolicyRetentionRuleClientObject.md | 13 ++++++------- .../help/New-AzDataProtectionBackupPolicy.md | 4 ++-- 6 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1 b/src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1 index 69863df713fa..ed43c93f8454 100644 --- a/src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1 +++ b/src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1 @@ -18,7 +18,7 @@ function Edit-AzDataProtectionPolicyRetentionRuleClientObject { ${Policy}, [Parameter(ParameterSetName='AddRetention',Mandatory, HelpMessage='Retention Rule Name.')] - [Parameter(ParameterSetName='RemoveRetention',Mandatory, HelpMessage='Retention Rule Name. Note: Default retention rules cannot be removed.')] + [Parameter(ParameterSetName='RemoveRetention',Mandatory, HelpMessage='Retention Rule Name. Note: "Default" retention rules cannot be removed, regardless of lifecycle.')] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.RetentionRuleName] ${Name}, @@ -30,7 +30,7 @@ function Edit-AzDataProtectionPolicyRetentionRuleClientObject { [System.Management.Automation.SwitchParameter] ${RemoveRule}, - [Parameter(ParameterSetName='AddRetention',Mandatory=$false, HelpMessage='[Deprecated] Specifies whether to modify an existing LifeCycle. Will be removed in a future release; duplicate retention rules are no longer permitted.')] + [Parameter(ParameterSetName='AddRetention',Mandatory=$false, HelpMessage='[Deprecated] Optional; this parameter will be removed in an upcoming release. Setting -OverwriteLifeCycle $false blocks updating an existing retention rule; when $true or omitted, the existing rule lifecycles are replaced in place — the default behavior once this parameter is removed.')] [Nullable[System.Boolean]] ${OverwriteLifeCycle}, diff --git a/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md b/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md index b94b24932693..651040ca703d 100644 --- a/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md +++ b/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md @@ -26,7 +26,6 @@ Edit-AzDataProtectionPolicyRetentionRuleClientObject -IsDefault -LifeC ## DESCRIPTION Adds or removes Retention Rule to an existing backup policy. -Adding a retention rule whose `-Name` already exists on the policy is rejected unless `-OverwriteLifeCycle $true` is supplied. ## EXAMPLES @@ -75,7 +74,7 @@ DatasourceType ObjectType For AzureBlob, OperationalStore retention rules **must** be named `Default_OperationalStore`. The rule is added additively — the existing `Default` (VaultStore) retention rule on the policy template is preserved. Passing `-Name Default` with an OperationalStore lifecycle is rejected by validation. -Note: `-OverwriteLifeCycle` is deprecated and will be removed in a future release; duplicate retention rules are no longer permitted. +Note: `-OverwriteLifeCycle` is deprecated and will be removed in an upcoming release. Setting `-OverwriteLifeCycle $false` blocks updating an existing retention rule; when `$true` or omitted, the existing rule's lifecycles are replaced in place — the default behavior once this parameter is removed. ## PARAMETERS @@ -111,7 +110,7 @@ Accept wildcard characters: False ### -Name Retention Rule Name. -Note: Default retention rules cannot be removed. +Note: `"Default"` retention rules cannot be removed, regardless of lifecycle. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.RetentionRuleName @@ -127,7 +126,7 @@ Accept wildcard characters: False ``` ### -OverwriteLifeCycle -[Deprecated] Specifies whether to modify an existing LifeCycle. Will be removed in a future release; duplicate retention rules are no longer permitted. +[Deprecated] Optional; this parameter will be removed in an upcoming release. Setting `-OverwriteLifeCycle $false` blocks updating an existing retention rule; when `$true` or omitted, the existing rule's lifecycles are replaced in place — the default behavior once this parameter is removed. ```yaml Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] @@ -184,9 +183,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### Validation rules -* **Duplicate retention rules are rejected.** Adding a rule whose `-Name` already exists on the policy throws `Retention rule '' already exists. Use -OverwriteLifeCycle $true to update it.` Pass `-OverwriteLifeCycle $true` to replace the existing rule's lifecycles in place. -* **Default rule removal.** `-Name Default` cannot be removed via `-RemoveRule`; the cmdlet throws `Removing Default Retention Rule is not allowed. Please try again with different rule name.` -* **`-OverwriteLifeCycle` is deprecated** and will be removed in a future release; duplicate retention rules are no longer permitted. +* **`"Default"` retention rules cannot be removed**, regardless of lifecycle. `-RemoveRule -Name Default` throws `Removing Default Retention Rule is not allowed. Please try again with different rule name.` +* **`-OverwriteLifeCycle` is deprecated and will be removed in an upcoming release.** Setting `-OverwriteLifeCycle $false` blocks updating an existing retention rule; when `$true` or omitted, the existing rule's lifecycles are replaced in place — the default behavior once this parameter is removed. ## RELATED LINKS diff --git a/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupPolicy.md b/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupPolicy.md index 4d98da99db06..af1a6f4f09b9 100644 --- a/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupPolicy.md +++ b/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupPolicy.md @@ -166,8 +166,8 @@ Name Type operationalVaultedPolicyName Microsoft.DataProtection/backupVaults/backupPolicies ``` -The first command gets the default vaulted policy template for AzureBlob. The template ships with a `Default` (Vault) retention rule. -The second and third commands add an OperationalStore retention rule named `Default_OperationalStore` to the policy. This is **additive** — the existing `Default` Vault rule is preserved. +The first command gets the default vaulted policy template for AzureBlob. The template ships with a `Default` (VaultStore) retention rule. +The second and third commands add an OperationalStore retention rule named `Default_OperationalStore` to the policy. This is **additive** — the existing `Default` (VaultStore) rule is preserved. The fourth through fifteenth commands define and update the vaulted weekly, monthly, yearly lifecycles and tag criteria. Next we define a trigger object with schedule time and timezone, set it to 2:30 AM West Europe standard time. The last command creates the hybrid AzureBlob policy. diff --git a/src/DataProtection/DataProtection.Autorest/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md b/src/DataProtection/DataProtection.Autorest/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md index 3853e5fd0e7b..8e92454e5a4b 100644 --- a/src/DataProtection/DataProtection.Autorest/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md +++ b/src/DataProtection/DataProtection.Autorest/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md @@ -41,5 +41,5 @@ DatasourceType ObjectType For AzureBlob, OperationalStore retention rules **must** be named `Default_OperationalStore`. The rule is added additively — the existing `Default` (VaultStore) retention rule on the policy template is preserved. Passing `-Name Default` with an OperationalStore lifecycle is rejected by validation. -Note: `-OverwriteLifeCycle` is deprecated and will be removed in a future release; duplicate retention rules are no longer permitted. +Note: `-OverwriteLifeCycle` is deprecated and will be removed in an upcoming release. Setting `-OverwriteLifeCycle $false` blocks updating an existing retention rule; when `$true` or omitted, the existing rule's lifecycles are replaced in place — the default behavior once this parameter is removed. diff --git a/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md b/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md index e5dbf0fdeadc..1db8d699caa3 100644 --- a/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md +++ b/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md @@ -27,7 +27,6 @@ Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy -Na ## DESCRIPTION Adds or removes Retention Rule to an existing backup policy. -Adding a retention rule whose `-Name` already exists on the policy is rejected unless `-OverwriteLifeCycle $true` is supplied. ## EXAMPLES @@ -76,7 +75,7 @@ DatasourceType ObjectType For AzureBlob, OperationalStore retention rules **must** be named `Default_OperationalStore`. The rule is added additively — the existing `Default` (VaultStore) retention rule on the policy template is preserved. Passing `-Name Default` with an OperationalStore lifecycle is rejected by validation. -Note: `-OverwriteLifeCycle` is deprecated and will be removed in a future release; duplicate retention rules are no longer permitted. +Note: `-OverwriteLifeCycle` is deprecated and will be removed in an upcoming release. Setting `-OverwriteLifeCycle $false` blocks updating an existing retention rule; when `$true` or omitted, the existing rule's lifecycles are replaced in place — the default behavior once this parameter is removed. ## PARAMETERS @@ -111,7 +110,8 @@ Accept wildcard characters: False ``` ### -Name -Retention Rule Name +Retention Rule Name. +Note: `"Default"` retention rules cannot be removed, regardless of lifecycle. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.RetentionRuleName @@ -127,7 +127,7 @@ Accept wildcard characters: False ``` ### -OverwriteLifeCycle -[Deprecated] Specifies whether to modify an existing LifeCycle. Will be removed in a future release; duplicate retention rules are no longer permitted. +[Deprecated] Optional; this parameter will be removed in an upcoming release. Setting `-OverwriteLifeCycle $false` blocks updating an existing retention rule; when `$true` or omitted, the existing rule's lifecycles are replaced in place — the default behavior once this parameter is removed. ```yaml Type: System.Nullable`1[System.Boolean] @@ -184,9 +184,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### Validation rules -* **Duplicate retention rules are rejected.** Adding a rule whose `-Name` already exists on the policy throws `Retention rule '' already exists. Use -OverwriteLifeCycle $true to update it.` Pass `-OverwriteLifeCycle $true` to replace the existing rule's lifecycles in place. -* **Default rule removal.** `-Name Default` cannot be removed via `-RemoveRule`; the cmdlet throws `Removing Default Retention Rule is not allowed. Please try again with different rule name.` -* **`-OverwriteLifeCycle` is deprecated** and will be removed in a future release; duplicate retention rules are no longer permitted. +* **`"Default"` retention rules cannot be removed**, regardless of lifecycle. `-RemoveRule -Name Default` throws `Removing Default Retention Rule is not allowed. Please try again with different rule name.` +* **`-OverwriteLifeCycle` is deprecated and will be removed in an upcoming release.** Setting `-OverwriteLifeCycle $false` blocks updating an existing retention rule; when `$true` or omitted, the existing rule's lifecycles are replaced in place — the default behavior once this parameter is removed. ## RELATED LINKS diff --git a/src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md b/src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md index f4081f2cdc93..5a841458f3a1 100644 --- a/src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md +++ b/src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md @@ -166,8 +166,8 @@ Name Type operationalVaultedPolicyName Microsoft.DataProtection/backupVaults/backupPolicies ``` -The first command gets the default vaulted policy template for AzureBlob. The template ships with a `Default` (Vault) retention rule. -The second and third commands add an OperationalStore retention rule named `Default_OperationalStore` to the policy. This is **additive** — the existing `Default` Vault rule is preserved. +The first command gets the default vaulted policy template for AzureBlob. The template ships with a `Default` (VaultStore) retention rule. +The second and third commands add an OperationalStore retention rule named `Default_OperationalStore` to the policy. This is **additive** — the existing `Default` (VaultStore) rule is preserved. The fourth through fifteenth commands define and update the vaulted weekly, monthly, yearly lifecycles and tag criteria. Next we define a trigger object with schedule time and timezone, set it to 2:30 AM West Europe standard time. The last command creates the hybrid AzureBlob policy. From 09c924855aeec1f363b7c4d1afe78f5e5a65f23e Mon Sep 17 00:00:00 2001 From: ianna1-admin Date: Wed, 20 May 2026 12:18:12 -0500 Subject: [PATCH 3/3] fix linting documentation issues --- .../Edit-AzDataProtectionPolicyRetentionRuleClientObject.md | 2 -- .../Edit-AzDataProtectionPolicyRetentionRuleClientObject.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md b/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md index 651040ca703d..288a48b8eb24 100644 --- a/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md +++ b/src/DataProtection/DataProtection.Autorest/docs/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md @@ -181,8 +181,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -### Validation rules - * **`"Default"` retention rules cannot be removed**, regardless of lifecycle. `-RemoveRule -Name Default` throws `Removing Default Retention Rule is not allowed. Please try again with different rule name.` * **`-OverwriteLifeCycle` is deprecated and will be removed in an upcoming release.** Setting `-OverwriteLifeCycle $false` blocks updating an existing retention rule; when `$true` or omitted, the existing rule's lifecycles are replaced in place — the default behavior once this parameter is removed. diff --git a/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md b/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md index 1db8d699caa3..58ffe0a8c79f 100644 --- a/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md +++ b/src/DataProtection/DataProtection/help/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md @@ -182,8 +182,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -### Validation rules - * **`"Default"` retention rules cannot be removed**, regardless of lifecycle. `-RemoveRule -Name Default` throws `Removing Default Retention Rule is not allowed. Please try again with different rule name.` * **`-OverwriteLifeCycle` is deprecated and will be removed in an upcoming release.** Setting `-OverwriteLifeCycle $false` blocks updating an existing retention rule; when `$true` or omitted, the existing rule's lifecycles are replaced in place — the default behavior once this parameter is removed.