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
- Go to your Azure Container Registry
- In the Overview tab, verify the status of the Soft Delete (Preview)
- If the status is Disabled, Select Update.
- Select the checkbox to Enable Soft Delete
- Select the number of days 1-90 that a deleted artifact persists until it’s permanently deleted.
- Select Save option
From the Azure portal Restore the soft deleted artifacts
- Go to Azure Container Registry
- Select Services, and Select Repositories
- In the Repositories, Select your preferred Repository
- Select on the Manage deleted artifacts to see all the soft deleted artifacts
- Select the deleted artifact you have to restore
- Select the artifact and click on the restore
- Select the tag to restore,
- Click on the Restore.
For more details, refer soft delete policy