Review Azure Backup Vault soft delete

Verify soft delete and retention in Azure Backup Vault so accidental or malicious deletion leaves time to recover backups.

Description

Soft delete lets you recover deleted vaulted backups during the retention period. In Azure public regions where soft delete is enforced, requesting soft_delete = "Off" cannot disable protection for supported backups.

Potential impact

A needed recovery point may be lost if protection is actually off or you discover the deletion after retention expires.

Remediation

  • In the Azure portal, open the deployed Backup vault. Check its soft-delete state, retention in days and support for the workload you back up.
  • In AzureRM 4.50.0, set soft_delete to On or AlwaysOn to enable protection. Check the supported values for other versions. AlwaysOn is irreversible, so review the retention period and costs first.
  • Set deletion alerts and test that you can restore within the retention period. Use immutability and least-privilege access as well.

Examples

The examples use different vault names. When updating an existing vault, keep its actual name and check the Terraform plan for replacement.

Before

hcl
resource "azurerm_data_protection_backup_vault" "backup_vault" {
  name                = "app-backup-vault"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  datastore_type      = "VaultStore"
  redundancy          = "LocallyRedundant"
  soft_delete         = "Off"
}

After

hcl
resource "azurerm_data_protection_backup_vault" "backup_vault" {
  name                = "protected-backup-vault"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  datastore_type      = "VaultStore"
  redundancy          = "LocallyRedundant"
  soft_delete         = "AlwaysOn"
}

References