Skip to content

Commit c896785

Browse files
committed
updated soft delete setting parameters
added examples for New/Update backup vault re-recorded test case
1 parent 00cad7d commit c896785

14 files changed

+293
-331
lines changed

src/DataProtection/Az.DataProtection.psd1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050
'Stop-AzDataProtectionBackupInstanceProtection',
5151
'Suspend-AzDataProtectionBackupInstanceBackup',
5252
'Sync-AzDataProtectionBackupInstance',
53-
'Update-AzDataProtectionResourceGuard',
54-
'New-AzDataProtectionSoftDeleteSettingObject'
53+
'Update-AzDataProtectionResourceGuard'
5554
AliasesToExport = '*'
5655
PrivateData = @{
5756
PSData = @{

src/DataProtection/README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ directive:
6666
parameter-name: CrossSubscriptionRestoreState
6767
parameter-description: Cross subscription restore state of the vault. Allowed values are Disabled, Enabled, PermanentlyDisabled.
6868
clear-alias: true
69+
- where:
70+
parameter-name: SoftDeleteSettingRetentionDurationInDay
71+
set:
72+
parameter-name: SoftDeleteRetentionDurationInDay
73+
parameter-description: Soft delete retention duration in days.
74+
clear-alias: true
75+
- where:
76+
parameter-name: SoftDeleteSettingState
77+
set:
78+
parameter-name: SoftDeleteState
79+
parameter-description: Soft delete state of the vault. Allowed values are Off, On, AlwaysOn.
80+
clear-alias: true
6981
- where:
7082
parameter-name: SecuritySettingSoftDeleteSetting
7183
set:
@@ -249,6 +261,14 @@ directive:
249261
property-name: CrossSubscriptionRestoreSettingState
250262
set:
251263
property-name: CrossSubscriptionRestoreState
264+
- where:
265+
property-name: SoftDeleteSettingRetentionDurationInDay
266+
set:
267+
property-name: SoftDeleteRetentionDurationInDay
268+
- where:
269+
property-name: SoftDeleteSettingState
270+
set:
271+
property-name: SoftDeleteState
252272
- where:
253273
model-name: BackupVaultResource
254274
set:
@@ -268,8 +288,7 @@ directive:
268288
- RestoreTargetInfoBase
269289
- PolicyParameters
270290
- SecretStoreBasedAuthCredentials
271-
- SecretStoreResource
272-
- SoftDeleteSettings
291+
- SecretStoreResource
273292
- SystemData
274293
- UserFacingError
275294
- from: source-file-csharp

src/DataProtection/custom/Cmdlets/Platform/Vault/New-AzDataProtectionBackupVault.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,14 @@
4848
[ValidateSet('Disabled','Enabled', 'PermanentlyDisabled')]
4949
${CrossSubscriptionRestoreState},
5050

51-
[Parameter(Mandatory=$false, HelpMessage='Soft delete related settings')]
52-
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.ISoftDeleteSettings]
53-
${SoftDeleteSetting},
51+
[Parameter(Mandatory=$false, HelpMessage='Soft delete retention duration in days')]
52+
[System.Double]
53+
${SoftDeleteRetentionDurationInDay},
54+
55+
[Parameter(Mandatory=$false, HelpMessage='Soft delete state of the vault. Allowed values are Off, On, AlwaysOn')]
56+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SoftDeleteState]
57+
[ValidateSet('Off','On', 'AlwaysOn')]
58+
${SoftDeleteState},
5459

5560
[Parameter(HelpMessage='Resource tags.')]
5661
[System.Collections.Hashtable]

src/DataProtection/custom/Cmdlets/Platform/Vault/New-AzDataProtectionSoftDeleteSettingObject.ps1

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/DataProtection/docs/Az.DataProtection.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ Creates a resource guard under a resource group
8080
### [New-AzDataProtectionRetentionLifeCycleClientObject](New-AzDataProtectionRetentionLifeCycleClientObject.md)
8181
Creates new Lifecycle object
8282

83-
### [New-AzDataProtectionSoftDeleteSettingObject](New-AzDataProtectionSoftDeleteSettingObject.md)
84-
Get Backup Vault soft delete setting object
85-
8683
### [Remove-AzDataProtectionBackupInstance](Remove-AzDataProtectionBackupInstance.md)
8784
Delete a backupInstances
8885

src/DataProtection/docs/New-AzDataProtectionBackupVault.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ New-AzDataProtectionBackupVault -Location <String> -ResourceGroupName <String>
1818
[-AzureMonitorAlertsForAllJobFailure <AlertsState>]
1919
[-CrossSubscriptionRestoreState <CrossSubscriptionRestoreState>] [-DefaultProfile <PSObject>]
2020
[-ETag <String>] [-IdentityType <String>] [-ImmutabilityState <ImmutabilityState>] [-NoWait]
21-
[-SoftDeleteSetting <ISoftDeleteSettings>] [-SubscriptionId <String>] [-Tag <Hashtable>] [-Confirm] [-WhatIf]
22-
[<CommonParameters>]
21+
[-SoftDeleteRetentionDurationInDay <Double>] [-SoftDeleteState <SoftDeleteState>] [-SubscriptionId <String>]
22+
[-Tag <Hashtable>] [-Confirm] [-WhatIf] [<CommonParameters>]
2323
```
2424

2525
## DESCRIPTION
@@ -42,6 +42,21 @@ ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
4242

4343
This command creates a new backup vault.
4444

45+
### Example 2: Create a new backup vault with ImmutabilityState, CrossSubscriptionRestoreState, soft delete settings
46+
```powershell
47+
$sub = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
48+
$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
49+
New-AzDataProtectionBackupVault -SubscriptionId $sub "resourceGroupName" -VaultName "vaultName" -Location westus -StorageSetting $storagesetting -CrossSubscriptionRestoreState Enabled -ImmutabilityState Unlocked -SoftDeleteRetentionDurationInDay 100 -SoftDeleteState On
50+
```
51+
52+
```output
53+
ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
54+
---- ------------------- ---------------- ------------ -------- ---- ----
55+
westus MyVault Microsoft.DataProtection/backupVaults
56+
```
57+
58+
This command creates a new backup vault while setting Immutability state, cross subscription restore state, soft delete settings of the vault at creation time.
59+
4560
## PARAMETERS
4661

4762
### -AsJob
@@ -197,12 +212,27 @@ Accept pipeline input: False
197212
Accept wildcard characters: False
198213
```
199214
200-
### -SoftDeleteSetting
201-
Soft delete related settings
202-
To construct, see NOTES section for SOFTDELETESETTING properties and create a hash table.
215+
### -SoftDeleteRetentionDurationInDay
216+
Soft delete retention duration in days
217+
218+
```yaml
219+
Type: System.Double
220+
Parameter Sets: (All)
221+
Aliases:
222+
223+
Required: False
224+
Position: Named
225+
Default value: None
226+
Accept pipeline input: False
227+
Accept wildcard characters: False
228+
```
229+
230+
### -SoftDeleteState
231+
Soft delete state of the vault.
232+
Allowed values are Off, On, AlwaysOn
203233
204234
```yaml
205-
Type: Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.ISoftDeleteSettings
235+
Type: Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SoftDeleteState
206236
Parameter Sets: (All)
207237
Aliases:
208238

@@ -324,10 +354,6 @@ COMPLEX PARAMETER PROPERTIES
324354
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
325355
326356
327-
`SOFTDELETESETTING <ISoftDeleteSettings>`: Soft delete related settings
328-
- `[RetentionDurationInDay <Double?>]`: Soft delete retention duration
329-
- `[State <SoftDeleteState?>]`: State of soft delete
330-
331357
`STORAGESETTING <IStorageSetting[]>`: Storage Settings of the vault. Use New-AzDataProtectionBackupVaultStorageSetting Cmdlet to Create.
332358
- `[DatastoreType <StorageSettingStoreTypes?>]`: Gets or sets the type of the datastore.
333359
- `[Type <StorageSettingTypes?>]`: Gets or sets the type.

src/DataProtection/docs/New-AzDataProtectionSoftDeleteSettingObject.md

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/DataProtection/docs/Update-AzDataProtectionBackupVault.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ For example, updating tags for a resource.
1818
Update-AzDataProtectionBackupVault -ResourceGroupName <String> -VaultName <String> [-SubscriptionId <String>]
1919
[-AzureMonitorAlertsForAllJobFailure <AlertsState>]
2020
[-CrossSubscriptionRestoreState <CrossSubscriptionRestoreState>] [-IdentityType <String>]
21-
[-ImmutabilityState <ImmutabilityState>] [-SoftDeleteSetting <ISoftDeleteSettings>] [-Tag <Hashtable>]
22-
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
21+
[-ImmutabilityState <ImmutabilityState>] [-SoftDeleteRetentionDurationInDay <Double>]
22+
[-SoftDeleteState <SoftDeleteState>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait]
23+
[-Confirm] [-WhatIf] [<CommonParameters>]
2324
```
2425

2526
### UpdateViaIdentityExpanded
2627
```
2728
Update-AzDataProtectionBackupVault -InputObject <IDataProtectionIdentity>
2829
[-AzureMonitorAlertsForAllJobFailure <AlertsState>]
2930
[-CrossSubscriptionRestoreState <CrossSubscriptionRestoreState>] [-IdentityType <String>]
30-
[-ImmutabilityState <ImmutabilityState>] [-SoftDeleteSetting <ISoftDeleteSettings>] [-Tag <Hashtable>]
31-
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
31+
[-ImmutabilityState <ImmutabilityState>] [-SoftDeleteRetentionDurationInDay <Double>]
32+
[-SoftDeleteState <SoftDeleteState>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait]
33+
[-Confirm] [-WhatIf] [<CommonParameters>]
3234
```
3335

3436
## DESCRIPTION
@@ -67,6 +69,20 @@ This command disables the monitor alerts for all the job failures for the backup
6769
Allowed values are: Enabled, Disabled.
6870
Note that by default this setting is enabled.
6971

72+
### Example 3: Update vault ImmutabilityState, CrossSubscriptionRestoreState, soft delete settings
73+
```powershell
74+
Update-AzDataProtectionBackupVault -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -CrossSubscriptionRestoreState Disabled -ImmutabilityState Disabled -SoftDeleteRetentionDurationInDay 99 -SoftDeleteState Off
75+
```
76+
77+
```output
78+
Name Location Type IdentityType
79+
---- -------- ---- ------------
80+
vaultName southeastasia Microsoft.DataProtection/backupVaults SystemAssigned
81+
```
82+
83+
This command is used to modify Immutability state, cross subscription restore state, soft delete settings of the vault.
84+
These parameters are optional and can be used independently.
85+
7086
## PARAMETERS
7187

7288
### -AsJob
@@ -209,12 +225,27 @@ Accept pipeline input: False
209225
Accept wildcard characters: False
210226
```
211227
212-
### -SoftDeleteSetting
213-
Soft delete related settings
214-
To construct, see NOTES section for SOFTDELETESETTING properties and create a hash table.
228+
### -SoftDeleteRetentionDurationInDay
229+
Soft delete retention duration in days.
215230
216231
```yaml
217-
Type: Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.ISoftDeleteSettings
232+
Type: System.Double
233+
Parameter Sets: (All)
234+
Aliases:
235+
236+
Required: False
237+
Position: Named
238+
Default value: None
239+
Accept pipeline input: False
240+
Accept wildcard characters: False
241+
```
242+
243+
### -SoftDeleteState
244+
Soft delete state of the vault.
245+
Allowed values are Off, On, AlwaysOn.
246+
247+
```yaml
248+
Type: Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SoftDeleteState
218249
Parameter Sets: (All)
219250
Aliases:
220251

@@ -336,9 +367,5 @@ To create the parameters described below, construct a hash table containing the
336367
- `[SubscriptionId <String>]`: The ID of the target subscription. The value must be an UUID.
337368
- `[VaultName <String>]`: The name of the backup vault.
338369

339-
`SOFTDELETESETTING <ISoftDeleteSettings>`: Soft delete related settings
340-
- `[RetentionDurationInDay <Double?>]`: Soft delete retention duration
341-
- `[State <SoftDeleteState?>]`: State of soft delete
342-
343370
## RELATED LINKS
344371

src/DataProtection/examples/New-AzDataProtectionBackupVault.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,17 @@ ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
1313

1414
This command creates a new backup vault.
1515

16+
### Example 2: Create a new backup vault with ImmutabilityState, CrossSubscriptionRestoreState, soft delete settings
17+
```powershell
18+
$sub = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
20+
New-AzDataProtectionBackupVault -SubscriptionId $sub "resourceGroupName" -VaultName "vaultName" -Location westus -StorageSetting $storagesetting -CrossSubscriptionRestoreState Enabled -ImmutabilityState Unlocked -SoftDeleteRetentionDurationInDay 100 -SoftDeleteState On
21+
```
22+
23+
```output
24+
ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
25+
---- ------------------- ---------------- ------------ -------- ---- ----
26+
westus MyVault Microsoft.DataProtection/backupVaults
27+
```
28+
29+
This command creates a new backup vault while setting Immutability state, cross subscription restore state, soft delete settings of the vault at creation time.

0 commit comments

Comments
 (0)