The Set-AzRecoveryServicesVaultProperty cmdlet updates properties of a Recovery services vault. This cmdlet can be used to Enable/Disable/AlwaysON soft delete or set CMK encryption for a vault with two different parameter sets.
SoftDeleteFeatureState property of a vault can be disabled only if there are no registered containers in the vault. InfrastructureEncryption can only be set the first time a user updates the CMK vault.
Examples
Example 1: Update SoftDeleteFeatureState of a vault
The first command gets a Vault object and then stores it in the $vault variable.
The second command Updates the SoftDeleteFeatureState property of the vault to "Enabled" state. Allowed values for SoftDeleteFeatureState are Disable, Enable, AlwaysON.
Example 2: Update CMK encryption of a vault to use SystemAssigned MSIdentity
First cmdlet gets the RSVault to update encryption properties. Second cmdlet gets the azure key vault. Third cmdlet gets the key from the key vault.
Fourth cmdlet updates the customer managed encryption key within the RSVault to be accessed via SystemAssigned identity. Use -InfrastructureEncryption param to enable infrastructure encryption for the first time update.
Example 3: Update CMK encryption of a vault to use userAssigned MSIdentity
First cmdlet gets the RSVault to update encryption properties. Second cmdlet gets the azure key vault. Third cmdlet gets the key from the key vault.
Fourth cmdlet updates the customer managed encryption key within the RSVault to be accessed via UserAssigned identity.
Example 4: Update HybridBackupSecurityFeature of a vault
The first command gets a Vault object and then stores it in the $vault variable.
The second command disables the HybridBackupSecurityFeature of the vault, set $true to enable it again.
Example 5: Update SoftDeleteFeatureState and HybridBackupSecurityFeature to AlwaysON
The first command gets a Vault object and then stores it in the $vault variable.
The second command sets the SoftDeleteFeatureState of the vault to "AlwaysON", which will also set the HybridBackupSecurityFeature to AlwaysON. Additionally, the SoftDeleteRetentionPeriodInDays parameter is used to set the soft delete retention period to 16 days.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Optional flag ($true/$false) to disable/enable security setting for hybrid backups against accidental deletes and add additional layer of authentication for critical operations. Provide $false to enable the security.
Parameter to authorize operations protected by cross tenant resource guard. Use command (Get-AzAccessToken -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").Token to fetch authorization token for different tenant
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.