Skip to content

Commit 3f581fd

Browse files
authored
Merge pull request #276680 from AbhishekMallick-MS/May-30-2024-BVB
Blob vaulted backup - doc updated for command line based clients
2 parents bea410b + b169804 commit 3f581fd

19 files changed

+1850
-213
lines changed

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

Lines changed: 92 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
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.
4-
ms.topic: conceptual
5-
ms.date: 10/31/2022
4+
ms.topic: how-to
5+
ms.date: 05/30/2024
66
ms.assetid: 7c244b94-d736-40a8-b94d-c72077080bbe
77
ms.service: backup
88
ms.custom: engagement-fy23
@@ -12,52 +12,47 @@ ms.author: v-abhmallick
1212

1313
# Back up blobs in a storage account using Azure Data Protection via REST API
1414

15-
Azure Backup enables you to easily configure operational backup for protecting block blobs in your storage accounts.
15+
Azure Backup enables you to easily configure backup for protecting block blobs in your storage accounts.
1616

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
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. You can now perform [operational](blob-backup-overview.md?tabs=operational-backup) and [vaulted](blob-backup-overview.md?tabs=vaulted-backup) backups to protect block blobs in your storage accounts using Azure Backup.
2418

2519
For information on the Azure blob region availability, supported scenarios and limitations, see the [support matrix](blob-backup-support-matrix.md).
2620

2721
## Prerequisites
2822

23+
Before you back up blobs in a storage account using REST API, ensure that you:
24+
2925
- [Create a Backup vault](backup-azure-dataprotection-use-rest-api-create-update-backup-vault.md)
3026
- [Create a blob backup policy](backup-azure-dataprotection-use-rest-api-create-update-blob-policy.md)
3127

3228
## Configure backup
3329

3430
Once you create the vault and policy, you need to consider two critical points to protect all Azure Blobs within a storage account.
3531

36-
### Key entities
37-
38-
#### Storage account that contains the blobs for protection
32+
- Key entities
33+
- Permissions
3934

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.
35+
### Key entities
4136

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*.
37+
- **Storage account containing the blobs to be protected**: 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.
4338

44-
```http
45-
"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx/resourcegroups/RG-BlobBackup/providers/Microsoft.Storage/storageAccounts/msblobbackup"
46-
```
39+
For example, we'll use a storage account named *msblobbackup*, under the resource group *RG-BlobBackup*, in a different subscription and in *west US*.
4740

48-
#### Backup vault
41+
```http
42+
"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx/resourcegroups/RG-BlobBackup/providers/Microsoft.Storage/storageAccounts/msblobbackup"
43+
```
4944

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.
45+
- **Backup vault**: 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.
5146

52-
For example, we'll use a backup vault called *testBkpVault* in *West US* region under *TestBkpVaultRG* resource group.
47+
For example, we'll use a backup vault called *testBkpVault* in *West US* region under *TestBkpVaultRG* resource group.
5348

5449
### Assign permissions
5550

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).
51+
You need to assign a few permissions via Azure role-based access control (Azure RBAC) to the created 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).
5752

58-
### Prepare the request to configure backup
53+
### Prepare the request to configure blob backup
5954

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.
55+
Once the relevant permissions to the vault and storage account are set, and the vault and policy configuration are done, prepare the request to configure backup.
6156

6257
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.
6358

@@ -80,6 +75,44 @@ The following is the request body to configure backup for all blobs within a sto
8075
}
8176
}
8277
```
78+
To configure backup with vaulted backup (preview) enabled, refer the below request body.
79+
80+
```json
81+
{backupInstanceDataSourceType is Microsoft.Storage/storageAccounts/blobServices
82+
backupInstanceResourceType is Microsoft.Storage/storageAccounts
83+
{
84+
"id": null,
85+
"name": "{{backupInstanceName}}",
86+
"type": "Microsoft.DataProtection/backupvaults/backupInstances",
87+
"properties": {
88+
"objectType": "BackupInstance",
89+
"dataSourceInfo": {
90+
"objectType": "Datasource",
91+
"resourceID": "/subscriptions/{{backupInstanceSubscriptionId}}/resourceGroups/{{backupInstanceresourcegroup}}/providers/{{backupInstanceResourceType}}/{{backupInstanceName}}",
92+
"resourceName": "{{backupInstanceName}}",
93+
"resourceType": "{{backupInstanceResourceType}}",
94+
"resourceUri": "/subscriptions/{{backupInstanceSubscriptionId}}/resourceGroups/{{backupInstanceRG}}/providers/{{backupInstanceResourceType}}/{{backupInstanceName}}",
95+
"resourceLocation": "{{location}}",
96+
"datasourceType": "{{backupInstanceDataSourceType}}"
97+
},
98+
"policyInfo": {
99+
"policyId": "/subscriptions/{{subscription}}/resourceGroups/{{resourceGroup}}/providers/{{backupVaultRP}}/{{vaultName}}/backupPolicies/{{policyName}}",
100+
"name": "{{policyName}}",
101+
"policyVersion": "3.2",
102+
"policyParameters": {
103+
"dataStoreParametersList": [
104+
],
105+
"backupDatasourceParametersList" : [
106+
{
107+
"objectType": "BlobBackupDatasourceParameters",
108+
"containersList": ["container1", "container2", "container3", "container4", "container5"]
109+
}
110+
]
111+
}
112+
}
113+
}
114+
}
115+
```
83116

84117
### Validate the request to configure backup
85118

@@ -97,7 +130,7 @@ For example, this translates to:
97130
POST https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/validateForBackup?api-version=2021-01-01
98131
```
99132

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.
133+
The [request body](#prepare-the-request-to-configure-blob-backup) that you prepared earlier is used to give the details of the storage account to be protected.
101134

102135
#### Example request body
103136

@@ -120,6 +153,40 @@ The [request body](#prepare-the-request-to-configure-backup) that you prepared e
120153
}
121154
}
122155
```
156+
#### Example request body for vaulted backup (preview)
157+
158+
```json
159+
{
160+
"objectType": "ValidateForBackupRequest",
161+
"backupInstance": {
162+
"objectType": "BackupInstance",
163+
"dataSourceInfo": {
164+
"objectType": "Datasource",
165+
"resourceID": "/subscriptions/{{backupInstanceSubscriptionId}}/resourceGroups/{{backupInstanceRG}}/providers/{{backupInstanceResourceType}}/{{backupInstanceName}}",
166+
"resourceName": "{{backupInstanceName}}",
167+
"resourceType": "{{backupInstanceResourceType}}",
168+
"resourceUri": "/subscriptions/{{backupInstanceSubscriptionId}}/resourceGroups/{{backupInstanceRG}}/providers/{{backupInstanceResourceType}}/{{backupInstanceName}}",
169+
"resourceLocation": "{{location}}",
170+
"datasourceType": "{{backupInstanceDataSourceType}}"
171+
},
172+
"policyInfo": {
173+
"policyId": "/subscriptions/{{subscription}}/resourceGroups/{{resourceGroup}}/providers/{{backupVaultRP}}/{{vaultName}}/backupPolicies/{{policyName}}",
174+
"name": "{{policyName}}",
175+
"policyVersion": "3.2",
176+
"policyParameters": {
177+
"dataStoreParametersList": [
178+
] ,
179+
"backupDatasourceParametersList" : [
180+
{
181+
"objectType": "BlobBackupDatasourceParameters",
182+
"containersList": ["container1", "container2", "container3", "container4", "container5"]
183+
}
184+
]
185+
}
186+
}
187+
}
188+
}
189+
```
123190

124191
#### Responses for validate backup request
125192

articles/backup/backup-azure-dataprotection-use-rest-api-create-update-blob-policy.md

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Create Azure Backup policies for blobs using data protection REST API
33
description: In this article, you'll learn how to create and manage backup policies for blobs using REST API.
44
ms.topic: how-to
5-
ms.date: 10/28/2022
5+
ms.date: 05/30/2024
66
ms.assetid: 472d6a4f-7914-454b-b8e4-062e8b556de3
77
ms.service: backup
88
ms.custom: engagement-fy23
@@ -12,6 +12,8 @@ ms.author: v-abhmallick
1212

1313
# Create Azure Data Protection backup policies for blobs using REST API
1414

15+
This article describes how to create Azure Data Protection backup policies for Azure Blobs using REST API.
16+
1517
Azure Backup policy typically governs the retention and schedule of your backups. As operational backup for blobs is continuous in nature, you don't need a schedule to perform backups. The policy is essentially needed to specify the retention period. You can reuse the backup policy to configure backup for multiple storage accounts to a vault.
1618

1719
> [!IMPORTANT]
@@ -60,7 +62,7 @@ The following request body defines a backup policy for blob backups.
6062
The policy says:
6163

6264
- Retention period is 30 days.
63-
- Datastore is 'operational store' since the backups are local and no data is stored in the Backup vault.
65+
- Datastore is 'operational store'.
6466

6567
```json
6668
{
@@ -92,6 +94,92 @@ The policy says:
9294
}
9395
```
9496

97+
To configure a backup policy with the vaulted backup (preview), use the following JSON script:
98+
99+
```json
100+
{
101+
"id": "/subscriptions/495944b2-66b7-4173-8824-77043bb269be/resourceGroups/Blob-Backup/providers/Microsoft.DataProtection/BackupVaults/yavovaultecy01/backupPolicies/TestPolicy",
102+
"name": "TestPolicy",
103+
"type": "Microsoft.DataProtection/BackupVaults/backupPolicies",
104+
"properties": {
105+
"policyRules": [
106+
{
107+
"name": "Default",
108+
"objectType": "AzureRetentionRule",
109+
"isDefault": true,
110+
"lifecycles": [
111+
{
112+
"deleteAfter": {
113+
"duration": "P30D",
114+
"objectType": "AbsoluteDeleteOption"
115+
},
116+
"sourceDataStore": {
117+
"dataStoreType": "OperationalStore",
118+
"objectType": "DataStoreInfoBase"
119+
},
120+
"targetDataStoreCopySettings": []
121+
}
122+
]
123+
},
124+
{
125+
"name": "Default",
126+
"objectType": "AzureRetentionRule",
127+
"isDefault": true,
128+
"lifecycles": [
129+
{
130+
"deleteAfter": {
131+
"duration": "P7D",
132+
"objectType": "AbsoluteDeleteOption"
133+
},
134+
"sourceDataStore": {
135+
"dataStoreType": "VaultStore",
136+
"objectType": "DataStoreInfoBase"
137+
},
138+
"targetDataStoreCopySettings": []
139+
}
140+
]
141+
},
142+
{
143+
"name": "BackupDaily",
144+
"objectType": "AzureBackupRule",
145+
"backupParameters": {
146+
"backupType": "Discrete",
147+
"objectType": "AzureBackupParams"
148+
},
149+
"dataStore": {
150+
"dataStoreType": "VaultStore",
151+
"objectType": "DataStoreInfoBase"
152+
},
153+
"trigger": {
154+
"schedule": {
155+
"timeZone": "UTC",
156+
"repeatingTimeIntervals": [
157+
"R/2024-05-08T14:00:00+00:00/P1D"
158+
]
159+
},
160+
"taggingCriteria": [
161+
{
162+
"isDefault": true,
163+
"taggingPriority": 99,
164+
"tagInfo": {
165+
"id": "Default_",
166+
"tagName": "Default"
167+
}
168+
}
169+
],
170+
"objectType": "ScheduleBasedTriggerContext"
171+
}
172+
}
173+
],
174+
"datasourceTypes": [
175+
"Microsoft.Storage/storageAccounts/blobServices"
176+
],
177+
"objectType": "BackupPolicy",
178+
"name": "TestPolicy"
179+
}
180+
}
181+
```
182+
95183
> [!IMPORTANT]
96184
> The supported time formats is *DateTime* only. They don't support *Time* format alone.
97185

0 commit comments

Comments
 (0)