Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2026-01-14 00:00 | #250 | in_progress |
Biased
|
| 2026-01-13 00:00 | #246 | completed |
Biased
|
| 2026-01-11 00:00 | #240 | completed |
Biased
|
| 2026-01-10 00:00 | #237 | completed |
Biased
|
| 2026-01-09 00:34 | #234 | completed |
Biased
|
| 2026-01-08 00:53 | #231 | completed |
Biased
|
| 2026-01-06 18:15 | #225 | cancelled |
Clean
|
| 2025-08-19 00:01 | #85 | completed |
Clean
|
| 2025-07-13 21:37 | #48 | completed |
Biased
|
| 2025-07-12 23:44 | #41 | cancelled |
Biased
|
2. Install **Az.Storage** preview module.
5. To check the current settings for blob soft delete, use the `Get-AzStorageServiceProperty` command:
Enable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName <resource-group> `
-StorageAccountName <storage-account> `
-RetentionDays 7
$properties = Get-AzStorageBlobServiceProperty -ResourceGroupName <resource-group> `
-StorageAccountName <storage-account>
$properties.DeleteRetentionPolicy.Enabled
$properties.DeleteRetentionPolicy.Days
1. Specify the retention period. The default value is 7.
1. Save the template.
1. Specify the resource group of the account, and then choose the **Review + create** button to deploy the template and enable container soft delete.
---
## Enable blob soft delete (hierarchical namespace)
Blob soft delete can also protect blobs and directories in accounts that have the hierarchical namespace feature enabled on them.
<a id="enable-blob-soft-delete-hierarchical-namespace"></a>
### [Portal](#tab/azure-portal)
To enable blob soft delete for your storage account by using the Azure portal, follow these steps:
1. In the [Azure portal](https://portal.azure.com/), navigate to your storage account.
1. Locate the **Data Protection** option under **Data Management**.
1. In the **Recovery** section, select **Enable soft delete for blobs**.
1. Specify a retention period between 1 and 365 days. Microsoft recommends a minimum retention period of seven days.
1. Save your changes.
> [!div class="mx-imgBorder"]
> 
### [PowerShell](#tab/azure-powershell)
1. Install the latest **PowershellGet** module. Then, close and reopen the PowerShell console.
For more information about how to install PowerShell modules, see [Install the Azure PowerShell module](/powershell/azure/install-azure-powershell)
3. Obtain storage account authorization by using either a storage account key, a connection string, or Microsoft Entra ID. For more information, see [Connect to the account](data-lake-storage-directory-file-acl-powershell.md#connect-to-the-account).
The following example obtains authorization by using a storage account key.
4. To enable blob soft delete with PowerShell, use the [Enable-AzStorageDeleteRetentionPolicy](/powershell/module/az.storage/enable-azstoragedeleteretentionpolicy) command, and specify the retention period in days. The following example enables soft delete for an account, and sets the retention period to 4 days.
### [Azure CLI](#tab/azure-CLI) 1. Open the [Azure Cloud Shell](../../cloud-shell/overview.md), or if you've [installed](/cli/azure/install-azure-cli) the Azure CLI locally, open a command console application such as Windows PowerShell. 2. Install the `storage-preview` extension.