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-backup-blobs.md
+47-27Lines changed: 47 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,47 +2,64 @@
2
2
title: Back up blobs in a storage account using Azure Data Protection REST API.
3
3
description: In this article, learn how to configure, initiate, and manage backup operations of blobs using REST API.
4
4
ms.topic: conceptual
5
-
ms.date: 07/09/2021
5
+
ms.date: 10/31/2022
6
6
ms.assetid: 7c244b94-d736-40a8-b94d-c72077080bbe
7
+
author: v-amallick
8
+
ms.service: backup
9
+
ms.author: v-amallick
10
+
ms.custom: engagement-fy23
7
11
---
8
12
9
13
# Back up blobs in a storage account using Azure Data Protection via REST API
10
14
11
-
This article describes how to manage backups for blobs in a storage account via REST API. Backup of blobs is configured at the storage account level. So, all blobs in the storage account are protected with operational backup.
15
+
Azure Backup enables you to easily configure operational backup for protecting block blobs in your storage accounts.
16
+
17
+
This article describes how to configure backups for blobs in a storage account via REST API. Backup of blobs is configured at the storage account level. So, all blobs in the storage account are protected with operational backup.
18
+
19
+
In this article, you'll learn about:
20
+
21
+
> [!div class="checklist"]
22
+
> - Prerequisites
23
+
> - Configure backup
12
24
13
25
For information on the Azure blob region availability, supported scenarios and limitations, see the [support matrix](blob-backup-support-matrix.md).
14
26
15
27
## Prerequisites
16
28
17
29
-[Create a Backup vault](backup-azure-dataprotection-use-rest-api-create-update-backup-vault.md)
18
-
19
30
-[Create a blob backup policy](backup-azure-dataprotection-use-rest-api-create-update-blob-policy.md)
20
31
21
32
## Configure backup
22
33
23
-
Once the vault and policy are created, there are two critical points that the user needs to consider to protect all Azure blobs within a storage account.
34
+
Once you create the vault and policy, you need to consider two critical points to protect all Azure Blobs within a storage account.
35
+
36
+
### Key entities
24
37
25
-
###Key entities involved
38
+
#### Storage account that contains the blobs for protection
26
39
27
-
#### Storage account which contains the blobs to be protected
40
+
Fetch the Azure Resource Manager ID of the storage account which contains the blobs to be protected. This serves as the identifier of the storage account.
28
41
29
-
Fetch the Azure Resource Manager ID of the storage account which contains the blobs to be protected. This will serve as the identifier of the storage account. We will use an example of a storage account named _msblobbackup_, under the resource group _RG-BlobBackup_, in a different subscription and in west US.
42
+
For example, we'll use a storage account named *msblobbackup*, under the resource group *RG-BlobBackup*, in a different subscription and in *west US*.
The Backup vault requires permissions on the storage account to enable backups on blobs present within the storage account. The system-assigned managed identity of the vault is used for assigning such permissions. We will use an example of a backup vault called "testBkpVault" in "West US" region under "TestBkpVaultRG" resource group.
50
+
The Backup vault requires permissions on the storage account to enable backups on blobs present within the storage account. The system-assigned managed identity of the vault is used for assigning the permissions.
51
+
52
+
For example, we'll use a backup vault called *testBkpVault* in *West US* region under *TestBkpVaultRG* resource group.
38
53
39
54
### Assign permissions
40
55
41
-
You need to assign a few permissions via RBAC to vault (represented by vault MSI) and the relevant storage account. These can be performed via Portal or PowerShell or REST API. Learn more about all [related permissions](blob-backup-configure-manage.md#grant-permissions-to-the-backup-vault-on-storage-accounts).
56
+
You need to assign a few permissions via Azure role-based access control (Azure RBAC) to vault (represented by vault Managed Service Identity) and the relevant storage account. You can do these via Azure portal, PowerShell, or REST API. Learn more about all [related permissions](blob-backup-configure-manage.md#grant-permissions-to-the-backup-vault-on-storage-accounts).
42
57
43
58
### Prepare the request to configure backup
44
59
45
-
Once the relevant permissions are set to the vault and storage account, and the vault and policy are configured, we can prepare the request to configure backup. The following is the request body to configure backup for all blobs within a storage account. The Azure Resource Manager ID (ARM ID) of the storage account and its details are mentioned in the 'datasourceinfo' section and the policy information is present in the 'policyinfo' section.
60
+
Once you set the relevant permissions to the vault and storage account, and configure the vault and policy, prepare the request to configure backup.
61
+
62
+
The following is the request body to configure backup for all blobs within a storage account. The Azure Resource Manager ID (ARM ID) of the storage account and its details are mentioned in the *datasourceinfo* section and the policy information is present in the *policyinfo* section.
46
63
47
64
```json
48
65
{
@@ -66,21 +83,21 @@ Once the relevant permissions are set to the vault and storage account, and the
66
83
67
84
### Validate the request to configure backup
68
85
69
-
We can validate whether the request to configure backup or not will be successful or not using [the validate for backup API](/rest/api/dataprotection/backup-instances/validate-for-backup). The response can be used by customer to perform all required pre-requisites and then submit the configuration for backup request.
86
+
To validate if the request to configure backup will be successful, use [the validate for backup API](/rest/api/dataprotection/backup-instances/validate-for-backup). You can use the response to perform all required prerequisites and then submit the configuration for backup request.
70
87
71
-
Validate for backup request is a POST operation and the URI has `{subscriptionId}`, `{vaultName}`, `{vaultresourceGroupName}` parameters.
88
+
*Validate for backup request* is a *POST operation and the URI has `{subscriptionId}`, `{vaultName}`, `{vaultresourceGroupName}` parameters.
72
89
73
90
```http
74
91
POST https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{vaultresourceGroupname}/providers/Microsoft.DataProtection/backupVaults/{backupVaultName}/validateForBackup?api-version=2021-01-01
75
92
```
76
93
77
-
For example, this translates to
94
+
For example, this translates to:
78
95
79
96
```http
80
97
POST https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/validateForBackup?api-version=2021-01-01
81
98
```
82
99
83
-
The [request body](#prepare-the-request-to-configure-backup) that we prepared earlier will be used to give the details of the storage account to be protected.
100
+
The [request body](#prepare-the-request-to-configure-backup) that you prepared earlier is used to give the details of the storage account to be protected.
84
101
85
102
#### Example request body
86
103
@@ -120,7 +137,7 @@ It returns two responses: 202 (Accepted) when another operation is created and t
120
137
121
138
###### Error response
122
139
123
-
In case the given storage account is already protected, the response is HTTP 400 (Bad request) and clearly states that the given storage account is protected to a backup vault along with details.
140
+
If the given storage account is already protected, the response is HTTP 400 (Bad request) and clearly states that the given storage account is protected to a backup vault along with details.
124
141
125
142
```http
126
143
HTTP/1.1 400 BadRequest
@@ -167,9 +184,9 @@ X-Powered-By: ASP.NET
167
184
}
168
185
```
169
186
170
-
###### Tracking response
187
+
###### Track response
171
188
172
-
If the datasource is unprotected, then the API proceeds for further validations and creates a tracking operation.
189
+
If the data source is unprotected, then the API proceeds for further validations and creates a tracking operation.
Track the resulting operation using the "Azure-AsyncOperation" header with a simple *GET* command
210
+
Track the resulting operation using the *Azure-AsyncOperation* header with a simple *GET* command.
194
211
195
212
```http
196
213
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzM2NDdhZDNjLTFiNGEtNDU4YS05MGJkLTQ4NThiYjRhMWFkYg==?api-version=2021-01-01
@@ -204,7 +221,7 @@ GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
204
221
}
205
222
```
206
223
207
-
It returns 200(OK) once it completes and the response body lists further requirements to be fulfilled, such as permissions.
224
+
It returns 200(OK) once the validation completes and the response body lists further requirements to be fulfilled, such as permissions.
208
225
209
226
```http
210
227
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzM2NDdhZDNjLTFiNGEtNDU4YS05MGJkLTQ4NThiYjRhMWFkYg==?api-version=2021-01-01
@@ -246,7 +263,7 @@ GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
246
263
}
247
264
```
248
265
249
-
If all the permissions are granted, then resubmit the validate request, track the resulting operation and it will return 200(OK) as succeeded if all the conditions are met.
266
+
If all the permissions are granted, then resubmit the validate request and track the resulting operation. It returns 200(OK) as succeeded, if all the conditions are met.
250
267
251
268
```http
252
269
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzlhMjk2YWM2LWRjNDMtNGRjZS1iZTU2LTRkZDNiMDhjZDlkOA==?api-version=2021-01-01
@@ -262,11 +279,11 @@ GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
262
279
263
280
### Configure backup request
264
281
265
-
Once the request is validated, then you can submit the same to the [create backup instance API](/rest/api/dataprotection/backup-instances/create-or-update). A Backup instance represents an item protected with data protection service of Azure Backup within the backup vault. In this case, the storage account is the backup instance and you can use the same request body, which was validated above, with minor additions.
282
+
Once the request validation is complete, you can submit the same to the [create backup instance API](/rest/api/dataprotection/backup-instances/create-or-update). A Backup instance represents an item protected with data protection service of Azure Backup within the backup vault. In this case, the storage account is the backup instance and you can use the same request body, which was validated above, with minor additions.
266
283
267
-
You have to decide a unique name for the backup instance and hence we recommend you use a combination of the resource name and a unique identifier. We will use an example of "msblobbackup-f2df34eb-5628-4570-87b2-0331d797c67d" here and mark it as the backup instance name.
284
+
Use a unique name for the backup instance. So, we recommend you use a combination of the resource name and a unique identifier. In this example, use *msblobbackup-f2df34eb-5628-4570-87b2-0331d797c67d* here and mark it as the backup instance name.
268
285
269
-
To create or update the backup instance, use the following ***PUT*** operation.
286
+
To create or update the backup instance, use the following *PUT* operation.
270
287
271
288
```http
272
289
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/{BkpvaultName}/backupInstances/{UniqueBackupInstanceName}?api-version=2021-01-01
@@ -288,7 +305,7 @@ To create a backup instance, following are the components of the request body
288
305
289
306
##### Example request for configure backup
290
307
291
-
We will use the same request body that we used to validate the backup request with a unique name as we mentioned [above](#configure-backup).
308
+
Use the same request body that you used to validate the backup request with a unique name as we mentioned [above](#configure-backup).
292
309
293
310
```json
294
311
{
@@ -326,7 +343,10 @@ It returns two responses: 201 (Created) when backup instance is created and the
326
343
327
344
##### Example responses to configure backup request
328
345
329
-
Once you submit the *PUT* request to create a backup instance, the initial response is 201 (Created) with an Azure-asyncOperation header. Please note that the request body contains all the backup instance properties.
346
+
Once you submit the *PUT* request to create a backup instance, the initial response is 201 (Created) with an Azure-asyncOperation header.
347
+
348
+
>[Note]
349
+
>The request body contains all the backup instance properties.
330
350
331
351
```http
332
352
HTTP/1.1 201 Created
@@ -375,7 +395,7 @@ X-Powered-By: ASP.NET
375
395
}
376
396
```
377
397
378
-
Then track the resulting operation using the Azure-AsyncOperation header with a simple *GET* command.
398
+
Then track the resulting operation using the *Azure-AsyncOperation* header with a simple *GET* command.
379
399
380
400
```http
381
401
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzI1NWUwNmFlLTI5MjUtNDBkNy1iMjMxLTM0ZWZlMDA3NjdkYQ==?api-version=2021-01-01
@@ -398,7 +418,7 @@ Once the operation completes, it returns 200 (OK) with the success message in th
398
418
399
419
### Stop protection and delete data
400
420
401
-
To remove the protection on a storage account and delete the backup data as well, perform a delete operation as detailed [here](/rest/api/dataprotection/backup-instances/delete).
421
+
To remove the protection on a storage account and delete the backup data as well, follow [the delete operation process](/rest/api/dataprotection/backup-instances/delete).
402
422
403
423
Stopping protection and deleting data is a *DELETE* operation.
0 commit comments