How to Enable soft delete policy in Azure Container Registry
By: Date: 29/09/2022 Categories: azure Tags:

Soft delete policies are available in Azure Container Registry (ACR) to recover accidentally deleted artifacts. The feature is available to all service tiers (SKUs)

The Soft delete policy can be enable/disable at your discretion. When you enable the soft delete policy, ACR treats deleted artifacts as soft deleted artifacts with a specified retention period. As a result, you can list, filter, and restore soft deleted artifacts. When the retention period expires, all soft deleted artifacts are automatically purged.

The retention period is set to seven days by default. The retention period can be set to anything between one and 90 days.

Limitations to preview feature

  • Currently, ACR does not support manually removing soft deleted artifacts
  • Geo-replicated registries are not supported by the soft delete policy
  • It is not possible to enable both the retention policy and soft delete policy at the same time in ACR

From the Azure Portal – Enable soft delete policy

  1. Go to your Azure Container Registry
  2. In the Overview tab, verify the status of the Soft Delete (Preview)
  3. If the status is Disabled, Select Update.
  4. Select the checkbox to Enable Soft Delete
  5. Select the number of days 1-90 that a deleted artifact persists until it’s permanently deleted.
  6. Select Save option

From the Azure portal Restore the soft deleted artifacts

  1. Go to Azure Container Registry
  2. Select Services, and Select Repositories
  3. In the Repositories, Select your preferred Repository
  4. Select on the Manage deleted artifacts to see all the soft deleted artifacts
  5. Select the deleted artifact you have to restore
  6. Select the artifact and click on the restore
  7. Select the tag to restore,
  8. Click on the Restore.

For more details, refer soft delete policy