Skip to content

Commit 2fd5394

Browse files
authored
Merge pull request #113552 from tamram/tamram-0501a
point-in-time restore preview
2 parents cb72d2e + 30bb8f5 commit 2fd5394

File tree

5 files changed

+320
-6
lines changed

5 files changed

+320
-6
lines changed

articles/storage/blobs/TOC.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@
162162
href: snapshots-overview.md
163163
- name: Change feed
164164
href: storage-blob-change-feed.md
165+
- name: Point-in-time restore
166+
href: point-in-time-restore-overview.md
165167
- name: Access and performance tiers
166168
items:
167169
- name: Access tiers
@@ -379,7 +381,7 @@
379381
href: storage-blob-immutability-policies-manage.md
380382
- name: Manage data redundancy
381383
items:
382-
- name: Change how data is replicated
384+
- name: Change redundancy configuration
383385
href: ../common/redundancy-migration.md?toc=%2fazure%2fstorage%2fblobs%2ftoc.json
384386
- name: Design highly available applications
385387
href: ../common/geo-redundant-design.md?toc=%2fazure%2fstorage%2fblobs%2ftoc.json
@@ -393,6 +395,8 @@
393395
href: snapshots-manage-dotnet.md
394396
- name: Process change feed logs
395397
href: storage-blob-change-feed-how-to.md
398+
- name: Enable point-in-time restore
399+
href: point-in-time-restore-manage.md
396400
- name: Manage disaster recovery
397401
items:
398402
- name: Check the Last Sync Time property
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
---
2+
title: Enable and manage point-in-time restore for block blobs (preview)
3+
titleSuffix: Azure Storage
4+
description: Learn how to use point-in-time restore (preview) to restore block blobs to a state at an earlier point in time.
5+
services: storage
6+
author: tamram
7+
8+
ms.service: storage
9+
ms.topic: how-to
10+
ms.date: 05/06/2020
11+
ms.author: tamram
12+
ms.subservice: blobs
13+
---
14+
15+
# Enable and manage point-in-time restore for block blobs (preview)
16+
17+
You can use point-in-time restore (preview) to restore block blobs to their state at an earlier point in time. This article describes how to enable point-in-time restore for a storage account with PowerShell. It also shows how to perform a restore operation with PowerShell.
18+
19+
For more information and to learn how to register for the preview, see [Point-in-time restore for block blobs (preview)](point-in-time-restore-overview.md).
20+
21+
> [!CAUTION]
22+
> Point-in-time restore supports restoring operations on block blobs only. Operations on containers cannot be restored. If you delete a container from the storage account by calling the [Delete Container](/rest/api/storageservices/delete-container) operation during the point-in-time restore preview, that container cannot be restored with a restore operation. During the preview, instead of deleting a container, delete individual blobs if you may want to restore them.
23+
24+
> [!IMPORTANT]
25+
> The point-in-time restore preview is intended for non-production use only. Production service-level agreements (SLAs) are not currently available.
26+
27+
## Install the preview module
28+
29+
To configure Azure point-in-time restore with PowerShell, first install version [1.14.1-preview](https://www.powershellgallery.com/packages/Az.Storage/1.14.1-preview) of the Az.Storage PowerShell module. Follow these steps to install the preview module:
30+
31+
1. Uninstall any previous installations of Azure PowerShell from Windows using the **Apps & features** setting under **Settings**.
32+
33+
1. Make sure that you have the latest version of PowerShellGet installed. Open a Windows PowerShell window, and run the following command to install the latest version:
34+
35+
```powershell
36+
Install-Module PowerShellGet –Repository PSGallery –Force
37+
```
38+
39+
1. Close and reopen the PowerShell window after installing PowerShellGet.
40+
41+
1. Install the latest version of Azure PowerShell:
42+
43+
```powershell
44+
Install-Module Az –Repository PSGallery –AllowClobber
45+
```
46+
47+
1. Install the Az.Storage preview module:
48+
49+
```powershell
50+
Install-Module Az.Storage -Repository PSGallery -RequiredVersion 1.14.1-preview -AllowPrerelease -AllowClobber -Force
51+
```
52+
53+
For more information about installing Azure PowerShell, see [Install Azure PowerShell with PowerShellGet](/powershell/azure/install-az-ps).
54+
55+
## Enable and configure point-in-time restore
56+
57+
Before you enable and configure point-in-time restore, enable its prerequisites: soft delete, change feed, and blob versioning. For more information about enabling each of these features, see these articles:
58+
59+
- [Enable soft delete for blobs](soft-delete-enable.md)
60+
- [Enable and disable the change feed](storage-blob-change-feed.md#enable-and-disable-the-change-feed)
61+
- [Enable and manage blob versioning](versioning-enable.md)
62+
63+
To configure Azure point-in-time restore with PowerShell, call the Enable-AzStorageBlobRestorePolicy command. The following example enables soft delete and sets the soft-delete retention period, enables change feed, and then enables point-in-time restore. Before running the example, use the Azure portal or an Azure Resource Manager template to also enable blob versioning.
64+
65+
When running the example, remember to replace the values in angle brackets with your own values:
66+
67+
```powershell
68+
# Sign in to your Azure account.
69+
Connect-AzAccount
70+
71+
# Set resource group and account variables.
72+
$rgName = "<resource-group>"
73+
$accountName = "<storage-account>"
74+
75+
# Enable soft delete with a retention of 6 days.
76+
Enable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName $rgName `
77+
-StorageAccountName $accountName `
78+
-RetentionDays 6
79+
80+
# Enable change feed.
81+
Update-AzStorageBlobServiceProperty -ResourceGroupName $rgName `
82+
-StorageAccountName $accountName `
83+
-EnableChangeFeed $true
84+
85+
# Enable point-in-time restore with a retention period of 5 days.
86+
# The retention period for point-in-time restore must be at least one day less than that set for soft delete.
87+
Enable-AzStorageBlobRestorePolicy -ResourceGroupName $rgName `
88+
-StorageAccountName $accountName `
89+
-RestoreDays 5
90+
91+
# View the service settings.
92+
Get-AzStorageBlobServiceProperty -ResourceGroupName $rgName `
93+
-StorageAccountName $accountName
94+
```
95+
96+
## Perform a restore operation
97+
98+
To initiate a restore operation, call the Restore-AzStorageBlobRange command, specifying the restore point as a UTC **DateTime** value. You can specify one or more lexicographical ranges of blobs to restore, or omit a range to restore all blobs in all containers in the storage account. The restore operation may take several minutes to complete.
99+
100+
Keep in mind the following rules when specifying a range of blobs to restore:
101+
102+
- The container pattern specified for the start range and end range must include a minimum of three characters. The forward slash (/) that is used to separate a container name from a blob name does not count toward this minimum.
103+
- Only one range can be specified per restore operation.
104+
- Wildcard characters are not supported. They are treated as standard characters.
105+
- You can restore blobs in the `$root` and `$web` containers by explicitly specifying them in a range passed to a restore operation. The `$root` and `$web` containers are restored only if they are explicitly specified. Other system containers cannot restored.
106+
107+
### Restore all containers in the account
108+
109+
To restore all containers and blobs in the storage account, call the Restore-AzStorageBlobRange command, omitting the `-BlobRestoreRange` parameter. The following example restores containers in the storage account to their state 12 hours before the present moment:
110+
111+
```powershell
112+
# Specify -TimeToRestore as a UTC value
113+
Restore-AzStorageBlobRange -ResourceGroupName $rgName `
114+
-StorageAccountName $accountName `
115+
-TimeToRestore (Get-Date).AddHours(-12)
116+
```
117+
118+
### Restore a single range of block blobs
119+
120+
To restore a range of blobs, call the Restore-AzStorageBlobRange command and specify a lexicographical range of container and blob names for the `-BlobRestoreRange` parameter. The start of the range is in inclusive, and the end of the range is exclusive.
121+
122+
For example, to restore the blobs in a single container named *sample-container*, you can specify a range that starts with *sample-container* and ends with *sample-container1*. There is no requirement for the containers named in the start and end ranges to exist. Because the end of the range is exclusive, even if the storage account includes a container named *sample-container1*, only the container named *sample-container* will be restored:
123+
124+
```powershell
125+
$range = New-AzStorageBlobRangeToRestore -StartRange sample-container -EndRange sample-container1
126+
```
127+
128+
To specify a subset of blobs in a container to restore, use a forward slash (/) to separate the container name from the blob pattern. For example, the following range selects blobs in a single container whose names begin with the letters *d* through *f*:
129+
130+
```powershell
131+
$range = New-AzStorageBlobRangeToRestore -StartRange sample-container/d -EndRange sample-container/g
132+
```
133+
134+
Next, provide the range to the Restore-AzStorageBlobRange command. Specify the restore point by providing a UTC **DateTime** value for the `-TimeToRestore` parameter. The following example restores blobs in the specified range to their state 3 days before the present moment:
135+
136+
```powershell
137+
# Specify -TimeToRestore as a UTC value
138+
Restore-AzStorageBlobRange -ResourceGroupName $rgName `
139+
-StorageAccountName $accountName `
140+
-BlobRestoreRange $range `
141+
-TimeToRestore (Get-Date).AddDays(-3)
142+
```
143+
144+
### Restore multiple ranges of block blobs
145+
146+
To restore multiple ranges of block blobs, specify an array of ranges for the `-BlobRestoreRange` parameter. The following example restores the complete contents of *container1* and *container4*:
147+
148+
```powershell
149+
$range1 = New-AzStorageBlobRangeToRestore -StartRange container1 -EndRange container2
150+
$range2 = New-AzStorageBlobRangeToRestore -StartRange container4 -EndRange container5
151+
152+
Restore-AzStorageBlobRange -ResourceGroupName $rgName `
153+
-StorageAccountName $accountName `
154+
-TimeToRestore (Get-Date).AddMinutes(-30) `
155+
-BlobRestoreRange @($range1, $range2)
156+
```
157+
158+
## Next steps
159+
160+
- [Point-in-time restore for block blobs (preview)](point-in-time-restore-overview.md)
161+
- [Soft delete](soft-delete-overview.md)
162+
- [Change feed (preview)](storage-blob-change-feed.md)
163+
- [Blob versioning (preview)](versioning-overview.md)
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: Point-in-time restore for block blobs (preview)
3+
titleSuffix: Azure Storage
4+
description: Point-in-time restore for block blobs provides protection against accidental deletion or corruption by enabling you to restore a storage account to its previous state at a given point in time.
5+
services: storage
6+
author: tamram
7+
8+
ms.service: storage
9+
ms.topic: conceptual
10+
ms.date: 05/06/2020
11+
ms.author: tamram
12+
ms.subservice: blobs
13+
---
14+
15+
# Point-in-time restore for block blobs (preview)
16+
17+
Point-in-time restore provides protection against accidental deletion or corruption by enabling you to restore block blob data to an earlier state. Point-in-time restore is useful in scenarios where a user or application accidentally deletes data or where an application error corrupts data. Point-in-time restore also enables testing scenarios that require reverting a data set to a known state before running further tests.
18+
19+
To learn how to enable point-in-time restore for a storage account, see [Enable and manage point-in-time restore for block blobs (preview)](point-in-time-restore-manage.md).
20+
21+
## How point-in-time restore works
22+
23+
To enable point-in-time restore, you create a management policy for the storage account and specify a retention period. During the retention period, you can restore block blobs from the present state to a state at a previous point in time.
24+
25+
To initiate a point-in-time restore, call the [Restore Blob Ranges](/rest/api/storagerp/storageaccounts/restoreblobranges) operation and specify a restore point in UTC time. You can specify a lexicographical range of container and blob names to restore, or omit the range to restore all containers in the storage account. The **Restore Blob Ranges** operation returns a restore ID that uniquely identifies the operation.
26+
27+
Azure Storage analyzes all changes that have been made to the specified blobs between the requested restore point, specified in UTC time, and the present moment. The restore operation is atomic, so it either succeeds completely in restoring all changes, or it fails. If there are any blobs that cannot be restored, then the operation fails, and read and write operations to the affected containers resume.
28+
29+
When you request a restore operation, Azure Storage blocks data operations on the blobs in the range being restored for the duration of the operation. Read, write, and delete operations are blocked in the primary location. Read operations from the secondary location may proceed during the restore operation if the storage account is geo-replicated.
30+
31+
Only one restore operation can be run on a storage account at a time. A restore operation cannot be canceled once it is in progress, but a second restore operation can be performed to undo the first operation.
32+
33+
To check the status of a point-in-time restore, call the **Get Restore Status** operation with the restore ID returned from the **Restore Blob Ranges** operation.
34+
35+
Keep in mind the following limitations on restore operations:
36+
37+
- A block that has been uploaded via [Put Block](/rest/api/storageservices/put-block) or [Put Block from URL](/rest/api/storageservices/put-block-from-url), but not committed via [Put Block List](/rest/api/storageservices/put-block-list), is not part of a blob and so is not restored as part of a restore operation.
38+
- A blob with an active lease cannot be restored. If a blob with an active lease is included in the range of blobs to restore, the restore operation will fail atomically.
39+
- Snapshots are not created or deleted as part of a restore operation. Only the base blob is restored to its previous state.
40+
- If a blob has moved between the hot and cool tiers in the period between the present moment and the restore point, the blob is restored to its previous tier. However, a blob that has moved to the archive tier will not be restored.
41+
42+
> [!CAUTION]
43+
> Point-in-time restore supports restoring operations on block blobs only. Operations on containers cannot be restored. If you delete a container from the storage account by calling the [Delete Container](/rest/api/storageservices/delete-container) operation during the point-in-time restore preview, that container cannot be restored with a restore operation. During the preview, instead of deleting a container, delete individual blobs if you may want to restore them.
44+
45+
### Prerequisites for point-in-time restore
46+
47+
Point-in-time restore requires that the following Azure Storage features are enabled:
48+
49+
- [Soft delete](soft-delete-overview.md)
50+
- [Change feed (preview)](storage-blob-change-feed.md)
51+
- [Blob versioning (preview)](versioning-overview.md)
52+
53+
Enable these features for the storage account before you enable point-in-time restore. Be sure to register for the change feed and blob versioning previews before you enable them.
54+
55+
### Retention period for point-in-time restore
56+
57+
When you enable point-in-time restore for a storage account, you specify a retention period. Block blobs in your storage account can be restored during the retention period.
58+
59+
The retention period begins when you enable point-in-time restore. Keep in mind that you cannot restore blobs to a state prior to the beginning of the retention period. For example, if you enabled point-in-time restore on May 1st with a retention of 30 days, then on May 15th you can restore to a maximum of 15 days. On June 1st, you can restore data from between 1 and 30 days.
60+
61+
The retention period for point-in-time restore must be at least one day less than the retention period specified for soft delete. For example, if the soft delete retention period is set to 7 days, then the point-in-time restore retention period may be between 1 and 6 days.
62+
63+
### Permissions for point-in-time restore
64+
65+
To initiate a restore operation, a client must have write permissions to all containers in the storage account. To grant permissions to authorize a restore operation with Azure Active Directory (Azure AD), assign the **Storage Account Contributor** role to the security principal at the level of the storage account, resource group, or subscription.
66+
67+
## About the preview
68+
69+
The point-in-time restore preview is available in the West Central US region. Point-in-time restore is supported for general-purpose v2 storage accounts only. Only data in the hot and cool access tiers can be restored with point-in-time restore.
70+
71+
The following regions support point-in-time restore in preview:
72+
73+
- Canada Central
74+
- Canada East
75+
- France Central
76+
77+
The preview includes the following limitations:
78+
79+
- Restoring premium block blobs is not supported.
80+
- Restoring blobs in the archive tier is not supported. For example, if a blob in the hot tier was moved to the archive tier two days ago, and a restore operation restores to a point three days ago, the blob is not restored to the hot tier.
81+
- Restoring Azure Data Lake Storage Gen2 flat and hierarchical namespaces is not supported.
82+
- Restoring storage accounts using customer-provided keys is not supported.
83+
84+
> [!IMPORTANT]
85+
> The point-in-time restore preview is intended for non-production use only. Production service-level agreements (SLAs) are not currently available.
86+
87+
### Register for the preview
88+
89+
To register for the preview, run the following commands from Azure PowerShell:
90+
91+
```powershell
92+
# Register for the point-in-time restore preview
93+
Register-AzProviderFeature -FeatureName RestoreBlobRanges -ProviderNamespace Microsoft.Storage
94+
95+
# Register for change feed (preview)
96+
Register-AzProviderFeature -FeatureName Changefeed -ProviderNamespace Microsoft.Storage
97+
98+
# Register for blob versioning (preview)
99+
Register-AzProviderFeature -ProviderNamespace Microsoft.Storage `
100+
-FeatureName Versioning
101+
102+
# Refresh the Azure Storage provider namespace
103+
Register-AzResourceProvider -ProviderNamespace Microsoft.Storage
104+
```
105+
106+
### Check registration status
107+
108+
To check the status of your registration, run the following commands:
109+
110+
```powershell
111+
Get-AzProviderFeature -ProviderNamespace Microsoft.Storage `
112+
-FeatureName RestoreBlobRanges
113+
114+
Get-AzProviderFeature -ProviderNamespace Microsoft.Storage `
115+
-FeatureName Changefeed
116+
```
117+
118+
## Pricing and billing
119+
120+
Billing for point-in-time restore depends on the amount of data processed to perform the restore operation. The amount of data processed is based on the number of changes that occurred between the restore point and the present moment. For example, assuming a relatively constant rate of change to block blob data in a storage account, a restore operation that goes back in time 1 day would cost 1/10th of a restore that goes back in time 10 days.
121+
122+
To estimate the cost of a restore operation, review the change feed log to estimate the amount of data that was modified during the restore period. For example, if the retention period for change feed is 30 days, and the size of the change feed is 10 MB, then restoring to a point 10 days earlier would cost approximately one-third of the price listed for an LRS account in that region. Restoring to a point that is 27 days earlier would cost approximately nine-tenths of the price listed.
123+
124+
For more information about pricing for point-in-time restore, see [Block blob pricing](https://azure.microsoft.com/pricing/details/storage/blobs/).
125+
126+
## Ask questions or provide feedback
127+
128+
To ask questions about the point-in-time restore preview, or to provide feedback, contact Microsoft at [email protected].
129+
130+
## Next steps
131+
132+
- [Enable and manage point-in-time restore for block blobs (preview)](point-in-time-restore-manage.md)
133+
- [Change feed support in Azure Blob Storage (Preview)](storage-blob-change-feed.md)
134+
- [Enable soft delete for blobs](soft-delete-enable.md)
135+
- [Enable and manage blob versioning](versioning-enable.md)

0 commit comments

Comments
 (0)