Skip to content

Commit b9fe12c

Browse files
authored
Merge pull request #112343 from roygara/fSD
Soft delete Files + Blobs
2 parents 853b23a + be9004a commit b9fe12c

File tree

8 files changed

+150
-1
lines changed

8 files changed

+150
-1
lines changed

articles/storage/files/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
href: storage-files-networking-overview.md
3232
- name: About cloud tiering
3333
href: storage-sync-cloud-tiering.md
34+
- name: Prevent accidental data deletion
35+
href: storage-files-prevent-file-share-deletion.md
3436
- name: About storage accounts
3537
href: ../common/storage-account-options.md?toc=%2fazure%2fstorage%2ffiles%2ftoc.json
3638
- name: Azure file share snapshots
@@ -118,6 +120,8 @@
118120
href: storage-sync-files-server-registration.md
119121
- name: Add an Azure File Sync Server endpoint
120122
href: storage-sync-files-server-endpoint.md
123+
- name: Enable soft delete
124+
href: storage-files-enable-soft-delete.md
121125
- name: Manage storage in Azure independent clouds
122126
href: ../common/storage-powershell-independent-clouds.md?toc=%2fazure%2fstorage%2ffiles%2ftoc.json
123127
- name: Manage data redundancy
125 KB
Loading
138 KB
Loading
38.6 KB
Loading
37.6 KB
Loading
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
title: Enable soft delete - Azure file shares
3+
description: Learn how to enable soft delete on Azure file shares for data recovery and preventing accidental deletion.
4+
author: roygara
5+
ms.service: storage
6+
ms.topic: conceptual
7+
ms.date: 05/22/2020
8+
ms.author: rogarana
9+
ms.subservice: files
10+
services: storage
11+
---
12+
13+
# Enable soft delete on Azure file shares
14+
15+
Azure Storage offers soft delete for file shares so that you can more easily recover your data when it is mistakenly deleted by an application or other storage account user. To learn more about soft delete, see [How to prevent accidental deletion of Azure file shares](storage-files-prevent-file-share-deletion.md).
16+
17+
The following sections show how to enable and use soft delete for Azure file shares on an existing storage account:
18+
19+
# [Portal](#tab/azure-portal)
20+
21+
1. Sign into the [Azure portal](https://portal.azure.com/).
22+
1. Navigate to your storage account and select **Soft delete** under **File service**.
23+
1. Select **Enabled** for **file share soft delete**.
24+
1. Select **File share retention period in days** and enter a number of your choosing.
25+
1. Select **Save** to confirm your data retention settings.
26+
27+
:::image type="content" source="media/storage-how-to-recover-deleted-account/enable-soft-delete-files.png" alt-text="Screenshot of the storage account soft delete settings pane. Highlighting the file shares section, enable toggle, set a retention period, and save. This will enable soft delete for all file shares in your storage account.":::
28+
29+
# [PowerShell](#tab/azure-powershell)
30+
31+
To enable soft delete, you must update a file client's service properties. The following example enables soft delete for all file shares in a storage account:
32+
33+
```azurepowershell-interactive
34+
$rgName = "yourResourceGroupName"
35+
$accountName = "yourStorageAccountName"
36+
37+
Update-AzStorageFileServiceProperty -ResourceGroupName $rgName -StorageAccountName $accountName -EnableShareDeleteRetentionPolicy $true -ShareRetentionDays 7
38+
```
39+
40+
You can verify if soft delete is enabled and view its retention policy with the following command:
41+
42+
```azurepowershell-interactive
43+
Get-AzStorageFileServiceProperty -ResourceGroupName $rgName -StorageAccountName $accountName
44+
```
45+
---
46+
47+
## Restore soft deleted file share
48+
49+
# [Portal](#tab/azure-portal)
50+
51+
To restore a soft deleted file share:
52+
53+
1. Navigate to your storage account and select **File shares**.
54+
1. On the file share blade, enable **Show deleted shares** to display any shares that have been soft deleted.
55+
56+
This will display any shares currently in a **Deleted** state.
57+
58+
:::image type="content" source="media/storage-how-to-recover-deleted-account/undelete-file-share.png" alt-text="If the status column, the column next to the name column, is set to deleted, then your file share is in a soft deleted state. And will be permanently deleted after your specified retention period.":::
59+
60+
1. Select the share and select **undelete**, this will restore the share.
61+
62+
You can confirm the share is restored since its status switches to **Active**.
63+
64+
:::image type="content" source="media/storage-how-to-recover-deleted-account/restored-file-share.png" alt-text="If the status column, the column next to the name column, is set to Active, then your file share has been restored.":::
65+
66+
# [PowerShell](#tab/azure-powershell)
67+
68+
To restore a soft deleted file share, use the following command:
69+
70+
```azurepowershell-interactive
71+
Restore-AzRmStorageShare -ResourceGroupName $rgname -StorageAccountName $accountName -DeletedShareVersion 01D5E2783BDCDA97
72+
```
73+
---
74+
75+
## Disable soft delete
76+
77+
If you wish to stop using soft delete, or permanently delete a file share, follow these instructions:
78+
79+
# [Portal](#tab/azure-portal)
80+
81+
1. Navigate to your storage account and select **Soft delete** under **Settings**.
82+
1. Under **File shares** select **Disabled** for **Soft delete for file shares**.
83+
1. Select **Save** to confirm your data retention settings.
84+
85+
:::image type="content" source="media/storage-how-to-recover-deleted-account/disable-soft-delete-files.png" alt-text="Disabling soft delete will allow you to immediately and permanently delete all file shares in your storage account at your leisure.":::
86+
87+
# [PowerShell](#tab/azure-powershell)
88+
89+
You can use the following command to disable soft delete on your storage account:
90+
91+
```azurepowershell-interactive
92+
Update-AzStorageFileServiceProperty -ResourceGroupName $rgName -StorageAccountName $accountName -EnableShareDeleteRetentionPolicy $false
93+
```
94+
---
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Prevent accidental deletion - Azure file shares
3+
description: Learn about soft delete for Azure file shares and how you can use it to for data recovery and preventing accidental deletion.
4+
author: roygara
5+
ms.service: storage
6+
ms.topic: conceptual
7+
ms.date: 05/22/2020
8+
ms.author: rogarana
9+
ms.subservice: files
10+
services: storage
11+
---
12+
13+
# Prevent accidental deletion of Azure file shares
14+
15+
Azure Storage now offers soft delete for file shares so that you can more easily recover your data when it is mistakenly deleted by an application or other storage account user.
16+
17+
## How soft delete works
18+
19+
When enabled, soft delete enables you to save and recover your file shares when they are deleted. When data is deleted, it transitions to a soft deleted state instead of being permanently erased. You can configure the amount of time soft deleted data is recoverable before it is permanently expired.
20+
21+
Soft delete can be enabled on new or existing file shares. Soft delete is also backwards compatible, so you don't have to make any changes to your applications to take advantage of the protections of soft delete.
22+
23+
For soft-deleted premium file shares, the file share quota (the provisioned size of a file share) is used in the total storage account quota calculation until the soft-deleted share expiry date, when the share is fully deleted.
24+
25+
### Availability
26+
27+
Soft delete for Azure file shares is available on all storage tiers, all storage account types, and in every region that Azure Files is available in.
28+
29+
## Configuration settings
30+
31+
Soft delete for file shares is enabled at the storage account level, the soft delete settings apply to all file shares within a storage account. When you create a new storage account, soft delete is off by default. Soft delete is also off by default for existing storage accounts. You can toggle the feature on and off at any time during the life of a storage account.
32+
33+
If you enable soft delete for file shares, delete some file shares, and then disable soft delete, you will still be able to access and recover those file shares, if those shares were saved when soft delete was enabled. When you turn on soft delete, you also need to configure the retention period.
34+
35+
The retention period indicates the amount of time that soft deleted file shares are stored and available for recovery. For file shares that are explicitly deleted, the retention period clock starts when the data is deleted. Currently you can retain soft deleted shares for between 1 and 365 days.
36+
37+
You can change the soft delete retention period at any time. An updated retention period will only apply to shares deleted after the retention period has been updated. Shares deleted prior to the retention period update will expire based on the retention period that was configured when that data was deleted.
38+
39+
To permanently delete a file share that is in a soft delete state prior to its expiry time, you must undelete the share, disable soft delete, and then delete the share again. Then you should reenable soft delete, since any other file shares in that storage account will be vulnerable to accidental deletion while soft delete is off.
40+
41+
## Pricing and billing
42+
43+
Both standard and premium file shares are billed on the used capacity when soft deleted, rather than provisioned capacity. Additionally, premium file shares are billed at the snapshot rate while in the soft delete state. Standard file shares are billed at the regular rate while in the soft delete state. You will not be charged for data that is permanently deleted after the configured retention period.
44+
45+
For more details on prices for Azure File Storage in general, see the [Azure File Storage Pricing Page](https://azure.microsoft.com/pricing/details/storage/files/).
46+
47+
When you initially turn on soft delete, we recommend using a small retention period to better understand how the feature affects your bill.
48+
49+
## Next steps
50+
51+
To learn how to enable and use soft delete, proceed to [Enable soft delete](storage-files-enable-soft-delete.md)

articles/storage/files/storage-snapshots-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ helping to improve data protection and recoverability. You can use the REST API,
7878

7979
Before you deploy the share snapshot scheduler, carefully consider your share snapshot frequency and retention settings to avoid incurring unnecessary charges.
8080

81-
Share snapshots provide only file-level protection. Share snapshots don't prevent fat-finger deletions on a file share or storage account. To help protect a storage account from accidental deletions, you can lock the storage account or the resource group.
81+
Share snapshots provide only file-level protection. Share snapshots don't prevent fat-finger deletions on a file share or storage account. To help protect a storage account from accidental deletions, you can either [enable soft delete](storage-files-prevent-file-share-deletion.md), or lock the storage account and/or the resource group.
8282

8383
## Next steps
8484
- Working with share snapshots in:

0 commit comments

Comments
 (0)