You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/backup/backup-azure-dataprotection-use-rest-api-restore-disks.md
+15-17Lines changed: 15 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,16 @@
2
2
title: Restore Azure Disks using Azure Data Protection REST API
3
3
description: In this article, learn how to restore Azure Disks using Azure Data protection REST API.
4
4
ms.topic: how-to
5
-
ms.date: 05/25/2023
5
+
ms.date: 05/27/2024
6
6
ms.assetid: 30f4e7ff-2a55-4a85-be44-55feedc24607
7
-
ms.custom: engagement-fy23
7
+
ms.custom: engagement-fy24
8
8
author: AbhishekMallick-MS
9
9
ms.author: v-abhmallick
10
10
---
11
11
12
12
# Restore Azure Disks using Azure Data Protection REST API
13
13
14
-
This article describes how to restore [disks](disk-backup-overview.md) using Azure Backup.
14
+
This article describes how to restore and create a new [Azure Disks](disk-backup-overview.md) using Azure Backup.
15
15
16
16
Azure Disk Backup offers a turnkey solution that provides snapshot lifecycle management for managed disks by automating periodic creation of snapshots and retaining it for configured duration using backup policy. You can manage the disk snapshots with zero infrastructure cost and without the need for custom scripting or any management overhead. This is a crash-consistent backup solution that takes point-in-time backup of a managed disk using incremental snapshots with support for multiple backups per day. It's also an agent-less solution and doesn't impact production application performance. It supports backup and restore of both OS and data disks (including shared disks), whether or not they're currently attached to a running Azure virtual machine.
17
17
@@ -29,17 +29,15 @@ Azure Disk Backup offers a turnkey solution that provides snapshot lifecycle man
29
29
30
30
In the example, we'll refer to an existing backup vault _TestBkpVault_, under the resource group _testBkpVaultRG_, where an Azure Disk is named _msdiskbackup-2dc6eb5b-d008-4d68-9e49-7132d99da0ed_.
31
31
32
-
## Restore to create a new Azure Disk
33
-
34
-
### Set up permissions
32
+
## Set up permissions
35
33
36
34
Backup vault uses managed identity to access other Azure resources. To restore from backup, Backup vault’s managed identity requires a set of permissions on the resource group where the disk needs to be restored.
37
35
38
36
Backup vault uses a system-assigned managed identity, which is restricted to one per resource and is tied to the lifecycle of this resource. To grant permissions to the managed identity, use the Azure role-based access control (Azure RBAC). Managed identity is a specific service principal that you may only use with Azure resources. Learn more about [Managed Identities](../active-directory/managed-identities-azure-resources/overview.md).
39
37
40
38
Assign the relevant permissions for vault's system-assigned managed identity on the target resource group where the disks will be restored/created. [Learn more](restore-managed-disks.md#restore-to-create-a-new-disk).
41
39
42
-
###Fetch the list of recovery points
40
+
## Fetch the list of recovery points
43
41
44
42
To list all the available recovery points for a backup instance, use the [list recovery points](/rest/api/dataprotection/recovery-points/list) API.
45
43
@@ -53,7 +51,7 @@ For example, this API translates to:
53
51
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/msdiskbackup-2dc6eb5b-d008-4d68-9e49-7132d99da0ed/recoveryPoints?api-version=2021-01-01
54
52
```
55
53
56
-
####Responses for list of recovery points
54
+
### Responses for list of recovery points
57
55
58
56
Once you submit the *GET* request, this returns response as 200 (OK) and the list of all discrete recovery points with all the relevant details.
59
57
@@ -150,13 +148,13 @@ X-Powered-By: ASP.NET
150
148
151
149
Select the relevant recovery points from the above list and proceed to prepare the restore request. We'll choose a recovery point named `a3d02fc3ab8a4c3a8cc26688c26d3356` from the above list to restore.
152
150
153
-
###Prepare the restore request
151
+
## Prepare the restore request
154
152
155
153
Construct the Azure Resource Manager (ARM) ID of the new disk to be created with the target resource group (to which permissions were assigned as detailed [above](#set-up-permissions)) and the required disk name.
156
154
157
155
For example, we'll use a disk named `APITestDisk2`, under a resource group `targetrg`, present in the same region as the backed-up disk, but under a different subscription.
158
156
159
-
####Construct the request body for restore request
157
+
### Construct the request body for restore request
160
158
161
159
The following request body contains the recovery point ID and the restore target details.
162
160
@@ -200,7 +198,7 @@ POST "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBk
200
198
201
199
[Learn more](/rest/api/dataprotection/backup-instances/validate-for-restore#request-body) about the request body for this POST API.
202
200
203
-
#####Request body to validate restore request
201
+
#### Request body to validate restore request
204
202
205
203
We have constructed a section of the same in the [above section](#construct-the-request-body-for-restore-request). Now, we'll add object type and use it to trigger a validate operation.
206
204
@@ -278,7 +276,7 @@ Track the _Azure-AsyncOperation_ header with a *GET* request. When the request i
278
276
}
279
277
```
280
278
281
-
####Trigger restore requests
279
+
## Trigger the restore requests
282
280
283
281
The trigger restore operation is a ***POST*** API. [Learn more](/rest/api/dataprotection/backup-instances/trigger-restore) about the trigger restore operation.
284
282
@@ -292,11 +290,11 @@ For example, the API translates to:
292
290
POST "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/msdiskbackup-2dc6eb5b-d008-4d68-9e49-7132d99da0ed/restore?api-version=2021-01-01"
293
291
```
294
292
295
-
#####Create a request body for restore operations
293
+
### Create a request body for restore operations
296
294
297
295
Once the requests are validated, use the same request body to trigger the _restore request_ with minor changes.
298
296
299
-
######Example request body for restore
297
+
### Example request body for restore
300
298
301
299
The only change from the validate restore request body is to remove the _restoreRequest_ object at the start and change the object type.
302
300
@@ -322,7 +320,7 @@ The only change from the validate restore request body is to remove the _restore
322
320
}
323
321
```
324
322
325
-
####Response to trigger restore requests
323
+
### Response to trigger restore requests
326
324
327
325
The _trigger restore request_ is an [asynchronous operation](../azure-resource-manager/management/async-operations.md). So, this operation creates another operation that needs to be tracked separately.
328
326
@@ -374,7 +372,7 @@ GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
374
372
}
375
373
```
376
374
377
-
####Track jobs
375
+
## Track the restore job
378
376
379
377
The _trigger restore requests_ triggered the restore job. To track the resultant Job ID, use the [GET Jobs API](/rest/api/dataprotection/jobs/get).
380
378
@@ -446,7 +444,7 @@ Use the *GET* command to track the _JobId_ present in the [trigger restore respo
446
444
447
445
The job status above indicates that the restore job is completed and the disks have been recovered to the specified subscription and target resource group.
448
446
449
-
## Next steps
447
+
## Next step
450
448
451
449
[Overview of Azure Disk backup](disk-backup-overview.md)
0 commit comments