Skip to content

Commit e127a95

Browse files
Merge pull request #216556 from v-amallick/Oct-20-2022-QualityStrategy
Quality Strategy - Freshness
2 parents 0ffcd7a + 7cf58fa commit e127a95

File tree

1 file changed

+47
-27
lines changed

1 file changed

+47
-27
lines changed

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

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,64 @@
22
title: Back up blobs in a storage account using Azure Data Protection REST API.
33
description: In this article, learn how to configure, initiate, and manage backup operations of blobs using REST API.
44
ms.topic: conceptual
5-
ms.date: 07/09/2021
5+
ms.date: 10/31/2022
66
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
711
---
812

913
# Back up blobs in a storage account using Azure Data Protection via REST API
1014

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
1224
1325
For information on the Azure blob region availability, supported scenarios and limitations, see the [support matrix](blob-backup-support-matrix.md).
1426

1527
## Prerequisites
1628

1729
- [Create a Backup vault](backup-azure-dataprotection-use-rest-api-create-update-backup-vault.md)
18-
1930
- [Create a blob backup policy](backup-azure-dataprotection-use-rest-api-create-update-blob-policy.md)
2031

2132
## Configure backup
2233

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
2437

25-
### Key entities involved
38+
#### Storage account that contains the blobs for protection
2639

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.
2841

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*.
3043

3144
```http
3245
"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx/resourcegroups/RG-BlobBackup/providers/Microsoft.Storage/storageAccounts/msblobbackup"
3346
```
3447

3548
#### Backup vault
3649

37-
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.
3853

3954
### Assign permissions
4055

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).
4257

4358
### Prepare the request to configure backup
4459

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.
4663

4764
```json
4865
{
@@ -66,21 +83,21 @@ Once the relevant permissions are set to the vault and storage account, and the
6683

6784
### Validate the request to configure backup
6885

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.
7087

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.
7289

7390
```http
7491
POST https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{vaultresourceGroupname}/providers/Microsoft.DataProtection/backupVaults/{backupVaultName}/validateForBackup?api-version=2021-01-01
7592
```
7693

77-
For example, this translates to
94+
For example, this translates to:
7895

7996
```http
8097
POST https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/validateForBackup?api-version=2021-01-01
8198
```
8299

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.
84101

85102
#### Example request body
86103

@@ -120,7 +137,7 @@ It returns two responses: 202 (Accepted) when another operation is created and t
120137

121138
###### Error response
122139

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.
124141

125142
```http
126143
HTTP/1.1 400 BadRequest
@@ -167,9 +184,9 @@ X-Powered-By: ASP.NET
167184
}
168185
```
169186

170-
###### Tracking response
187+
###### Track response
171188

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.
173190

174191
```http
175192
HTTP/1.1 202 Accepted
@@ -190,7 +207,7 @@ Location: https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxx
190207
X-Powered-By: ASP.NET
191208
```
192209

193-
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.
194211

195212
```http
196213
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
204221
}
205222
```
206223

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.
208225

209226
```http
210227
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
246263
}
247264
```
248265

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.
250267

251268
```http
252269
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
262279

263280
### Configure backup request
264281

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.
266283

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.
268285

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.
270287

271288
```http
272289
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
288305

289306
##### Example request for configure backup
290307

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).
292309

293310
```json
294311
{
@@ -326,7 +343,10 @@ It returns two responses: 201 (Created) when backup instance is created and the
326343

327344
##### Example responses to configure backup request
328345

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.
330350
331351
```http
332352
HTTP/1.1 201 Created
@@ -375,7 +395,7 @@ X-Powered-By: ASP.NET
375395
}
376396
```
377397

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.
379399

380400
```http
381401
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
398418
399419
### Stop protection and delete data
400420

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).
402422

403423
Stopping protection and deleting data is a *DELETE* operation.
404424

0 commit comments

Comments
 (0)