Skip to content

Commit 2525ece

Browse files
Merge pull request #252200 from AbhishekMallick-MS/Sep-18-2023-QS-BlobRestore
QS Freshness - Blob restore using REST
2 parents 98feb6f + c123dee commit 2525ece

File tree

2 files changed

+28
-41
lines changed

2 files changed

+28
-41
lines changed

articles/backup/backup-azure-dataprotection-use-rest-api-restore-blobs.md

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
title: Restore blobs in a storage account using Azure Data Protection REST API
33
description: In this article, learn how to restore blobs of a storage account using REST API.
44
ms.topic: conceptual
5-
ms.date: 07/09/2021
5+
ms.date: 09/20/2023
6+
ms.custom: engagement-fy24
67
ms.assetid: 9b8d21e6-3e23-4345-bb2b-e21040996afd
78
author: AbhishekMallick-MS
89
ms.author: v-abhmallick
@@ -15,25 +16,13 @@ This article describes how to restore [blobs](blob-backup-overview.md) to any po
1516
> [!IMPORTANT]
1617
> Before proceeding to restore Azure blobs using Azure Backup, see [important points](blob-restore.md#before-you-start).
1718
18-
In this article, you'll learn how to:
19-
20-
- Restore Azure blobs to point-in-time
21-
22-
- Track the restore operation status
23-
2419
## Prerequisites
2520

26-
- [Create a Backup vault](backup-azure-dataprotection-use-rest-api-create-update-backup-vault.md)
27-
28-
- [Create a blob backup policy](backup-azure-dataprotection-use-rest-api-create-update-blob-policy.md)
21+
This article assumes that you have an operational-blob-backup configured for one or more of your storage accounts. [Learn how to configure a backup for block blob data](backup-azure-dataprotection-use-rest-api-backup-blobs.md), if not done.
2922

30-
- [Configure a blob backup](backup-azure-dataprotection-use-rest-api-backup-blobs.md)
23+
To illustrate the restoration steps in this article, we will refer to blobs in a storage account named `"msblobbackup-f2df34eb-5628-4570-87b2-0331d797c67d"` protected with an existing Backup vault `TestBkpVault`, under the resource group `testBkpVaultRG`.
3124

32-
We will refer to an existing backup vault _TestBkpVault_, under the resource group _testBkpVaultRG_, where blobs in a storage account named "msblobbackup-f2df34eb-5628-4570-87b2-0331d797c67d" in the examples.
33-
34-
## Restoring Azure blobs within a storage account
35-
36-
### Fetching the valid time range for restore
25+
## Fetching the valid time range for restore
3726

3827
As the operational backup for blobs is continuous, there are no distinct points to restore from. Instead, we need to fetch the valid time-range under which blobs can be restored to any point-in-time. In this example, let's check for valid time-ranges to restore within the last 30 days.
3928

@@ -49,7 +38,7 @@ For our example, this translates to
4938
POST https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/msblobbackup-f2df34eb-5628-4570-87b2-0331d797c67d/findRestorableTimeRanges?api-version=2021-01-01
5039
```
5140

52-
#### Create the request body to fetch valid time ranges for restore
41+
### Create the request body to fetch valid time ranges for restore
5342

5443
To trigger an operation to calculate valid time ranges, following are the components of a request body
5544

@@ -59,7 +48,7 @@ To trigger an operation to calculate valid time ranges, following are the compon
5948
|startTime | String | Start time for the List Restore Ranges request. ISO 8601 format. |
6049
|endTime | String | End time for the List Restore Ranges request. ISO 8601 format. |
6150

62-
##### Example request body to fetch valid time range
51+
#### Example request body to fetch valid time range
6352

6453
The following request body defines properties required to fetch the time ranges of the continuous data which can be restored. Since blob backups reside in the storage account, the datastore is 'Operational'. You can give start and end time that helps to narrow the search process and return the available time range.
6554

@@ -115,15 +104,13 @@ X-Powered-By: ASP.NET
115104
}
116105
```
117106

118-
### Preparing the restore request
119-
120107
Once the point-in-time to restore to the same storage account is fixed, there are multiple options to restore.
121108

122-
#### Restoring all the blobs to a point-in-time
109+
## Option 1: Restore all the blobs to a point-in-time
123110

124111
Using this option restores all block blobs in the storage account by rolling them back to the selected point in time. Storage accounts containing large amounts of data or witnessing a high churn may take longer times to restore.
125112

126-
##### Constructing the request body for point-in-time restore of all blobs
113+
### Constructing the request body for point-in-time restore of all blobs
127114

128115
The key points to remember in this scenario are:
129116

@@ -156,7 +143,7 @@ The key points to remember in this scenario are:
156143
}
157144
```
158145

159-
#### Restoring few containers to a point-in-time
146+
## Option 2: Restore few containers to a point-in-time
160147

161148
Using this option allows you to select up to 10 containers to restore or restore a subset of blobs using a prefix match. You can specify up to 10 lexicographical ranges of blobs within a single container or across multiple containers to return those blobs to their previous state at a given point in time. In case of using prefixes, here are a few things to keep in mind:
162149

@@ -165,7 +152,7 @@ Using this option allows you to select up to 10 containers to restore or restore
165152

166153
[Learn more](blob-restore.md#use-prefix-match-for-restoring-blobs) about using prefixes to restore blob ranges.
167154

168-
##### Constructing the request body for point-in-time restore of selected containers or few blobs
155+
### Construct the request body for point-in-time restore of selected containers or few blobs
169156

170157
The key points to remember in this scenario are:
171158

@@ -205,9 +192,9 @@ The key points to remember in this scenario are:
205192
}
206193
```
207194

208-
#### Validating restore requests
195+
## Validate restore requests
209196

210-
Once request body is prepared, it can be validated using the [validate for restore API](/rest/api/dataprotection/backup-instances/validate-for-restore). Like the validate for backup API, this is a *POST* operation.
197+
Once request body is prepared, it can be validated using the [validate for restore API](/rest/api/dataprotection/backup-instances/validate-for-restore). Like the Validate-for-backup API, this is a *POST* operation.
211198

212199
```http
213200
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore?api-version=2021-01-01
@@ -219,20 +206,20 @@ For our example, this translates to:
219206
POST "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/msblobbackup-f2df34eb-5628-4570-87b2-0331d797c67d/validateRestore?api-version=2021-01-01"
220207
```
221208

222-
The request body for this POST API is detailed [here](/rest/api/dataprotection/backup-instances/validate-for-restore#request-body). We have constructed the same in the above section for [all blobs restore](#constructing-the-request-body-for-point-in-time-restore-of-all-blobs) and [few items restore](#constructing-the-request-body-for-point-in-time-restore-of-selected-containers-or-few-blobs) scenarios. We will use the same to trigger a validate operation.
209+
The request body for this POST API is detailed [here](/rest/api/dataprotection/backup-instances/validate-for-restore#request-body). We have constructed the same in the above section for [all blobs restore](#constructing-the-request-body-for-point-in-time-restore-of-all-blobs) and [few items restore](#construct-the-request-body-for-point-in-time-restore-of-selected-containers-or-few-blobs) scenarios. We will use the same to trigger a validate operation.
223210

224-
##### Response to validate restore requests
211+
### Response to validate restore requests
225212

226213
The validate restore request is an [asynchronous operation](../azure-resource-manager/management/async-operations.md). It means this operation creates another operation that needs to be tracked separately.
227214

228-
It returns two responses: 202 (Accepted) when another operation is created and then 200 (OK) when that operation completes.
215+
It returns two responses: 202 (Accepted) when another operation is created, and 200 (OK) when that operation completes.
229216

230217
|Name |Type |Description |
231218
|---------|---------|---------|
232219
|200 OK | | Status of validate request |
233220
|202 Accepted | | Accepted |
234221

235-
###### Example response to restore validate request
222+
#### Example response to restore validate-request
236223

237224
Once the *POST* operation is submitted, the initial response will be 202 Accepted along with an Azure-asyncOperation header.
238225

@@ -269,7 +256,7 @@ Track the Azure-AsyncOperation header with a simple *GET* request. When the requ
269256
}
270257
```
271258

272-
#### Triggering restore requests
259+
## Trigger restore requests
273260

274261
The triggering restore operation is a ***POST*** API. All details about the trigger restore operation are documented [here](/rest/api/dataprotection/backup-instances/trigger-restore).
275262

@@ -283,13 +270,13 @@ For our example, this translates to:
283270
POST "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/msblobbackup-f2df34eb-5628-4570-87b2-0331d797c67d/restore?api-version=2021-01-01"
284271
```
285272

286-
##### Creating a request body for restore operations
273+
### Create a request body for restore operations
287274

288275
Once the requests are validated, the same request body can be used to trigger the restore request with minor changes.
289276

290-
###### Example request body for all blobs restore
277+
#### Example request body for all blobs restore
291278

292-
The only change from the validate restore request body is to remove the "restoreRequest" object at the start.
279+
The only change from the validate-restore-request body is to remove the "restoreRequest" object at the start.
293280

294281
```json
295282
{
@@ -313,9 +300,9 @@ The only change from the validate restore request body is to remove the "restore
313300
}
314301
```
315302

316-
###### Example request body for items or few blobs restore
303+
#### Example request body for items or few blobs restore
317304

318-
The only change from the validate restore request body is to remove the "restoreRequest" object at the start.
305+
The only change from the validate-restore-request body is to remove the "restoreRequest" object at the start.
319306

320307
```json
321308
{
@@ -346,18 +333,18 @@ The only change from the validate restore request body is to remove the "restore
346333
}
347334
```
348335

349-
#### Response to trigger restore requests
336+
### Response to trigger restore requests
350337

351338
The trigger restore request is an [asynchronous operation](../azure-resource-manager/management/async-operations.md). It means this operation creates another operation that needs to be tracked separately.
352339

353-
It returns two responses: 202 (Accepted) when another operation is created and then 200 (OK) when that operation completes.
340+
It returns two responses: 202 (Accepted) when another operation is created, and 200 (OK) when that operation completes.
354341

355342
|Name |Type |Description |
356343
|---------|---------|---------|
357344
|200 OK | | Status of restore request |
358345
|202 Accepted | | Accepted |
359346

360-
##### Example response to trigger restore request
347+
#### Example response to trigger restore request
361348

362349
Once the *POST* operation is submitted, the initial response will be 202 Accepted along with an Azure-asyncOperation header.
363350

@@ -398,7 +385,7 @@ GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
398385
}
399386
```
400387

401-
#### Tracking jobs
388+
## Track jobs
402389

403390
The trigger restore requests triggered the restore job and the resultant Job ID should be tracking using the [GET Jobs API](/rest/api/dataprotection/jobs/get).
404391

articles/backup/backup-support-automation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ You can automate most backup related tasks using programmatic methods in Azure
8585
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
8686
| Backup | Create backup policy and configure backup | Supported <br><br> [See the examples](./backup-blobs-storage-account-ps.md). | Supported <br><br> [See the examples](./backup-blobs-storage-account-cli.md). | Supported <br><br> [See the examples](./backup-azure-dataprotection-use-rest-api-backup-blobs.md). | Currently not supported | Supported | Supported <br><br> [See the examples](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.dataprotection/backup-create-storage-account-enable-protection). | Supported <br><br> [See the examples](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/data_protection_backup_instance_blob_storage). |
8787
| Restore | Restore blobs | Supported <br><br> [See the examples](./restore-blobs-storage-account-ps.md). | Supported <br><br> [See the examples](./restore-blobs-storage-account-cli.md). | Supported <br><br> [See the examples](./backup-azure-dataprotection-use-rest-api-restore-blobs.md). | N/A | N/A | N/A | N/A |
88-
| Manage | Monitor jobs | Supported <br><br> [See the examples](./restore-blobs-storage-account-ps.md#tracking-job). | Supported <br><br> [See the examples](./restore-blobs-storage-account-cli.md#tracking-job). | Supported <br><br> [See the examples](./backup-azure-dataprotection-use-rest-api-restore-blobs.md#tracking-jobs). | N/A | N/A | N/A | N/A |
88+
| Manage | Monitor jobs | Supported <br><br> [See the examples](./restore-blobs-storage-account-ps.md#tracking-job). | Supported <br><br> [See the examples](./restore-blobs-storage-account-cli.md#tracking-job). | Supported <br><br> [See the examples](./backup-azure-dataprotection-use-rest-api-restore-blobs.md#track-jobs). | N/A | N/A | N/A | N/A |
8989
| Manage | Modify backup policy | Currently not supported | Currently not supported | Currently not supported | N/A | N/A | N/A | N/A |
9090
| Manage | Stop protection and retain backup data | Currently not supported | Currently not supported | Currently not supported | N/A | N/A | N/A | N/A |
9191
| Manage | Stop protection and delete backup data | Supported | Supported | Supported | N/A | N/A | N/A | N/A |

0 commit comments

Comments
 (0)