Skip to content

Commit c2789f4

Browse files
authored
Merge pull request #98182 from pvrk/Nov2019
REST API method to enable/disable Soft-delete
2 parents 9eb1413 + 2af5a65 commit c2789f4

File tree

2 files changed

+133
-0
lines changed

2 files changed

+133
-0
lines changed

articles/backup/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@
222222
items:
223223
- name: Create Recovery Services vault
224224
href: backup-azure-arm-userestapi-createorupdatevault.md
225+
- name: Update Recovery Services vault configurations
226+
href: use-restapi-update-vault-properties.md
225227
- name: Create and update backup policy
226228
href: backup-azure-arm-userestapi-createorupdatepolicy.md
227229
- name: Back up Azure VMs
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
title: Update Recovery Services vault configuration properties using REST API
3+
description: In this article, learn how to update vault's configuration using REST API.
4+
ms.topic: conceptual
5+
ms.date: 12/06/2019
6+
ms.assetid: 9aafa5a0-1e57-4644-bf79-97124db27aa2
7+
---
8+
# Update Azure Recovery Services Vault configurations using REST API
9+
10+
This article describes how to update backup related configurations in Azure Recovery Services vault using REST API.
11+
12+
## Soft delete state
13+
14+
Deleting backups of a protected item is a significant operation that has to be monitored. To protect against accidental deletions, Azure Recovery Services vault has a soft-delete capability. This capability allows customers to restore deleted backups, if necessary, within a time period after the deletion.
15+
16+
But there are scenarios in which this capability is not required. An Azure Recovery Services vault cannot be deleted if there are backup items within it, even soft-deleted ones. This may pose a problem if the vault needs to be immediately deleted. For for example: deployment operations often clean up the created resources in the same workflow. A deployment can create a vault, configure backups for an item, do a test restore and then proceed to delete the backup items and the vault. If the vault deletion fails, the entire deployment might fail. Disabling soft-delete is the only way to guarantee immediate deletion.
17+
18+
Hence, the customer needs to carefully choose whether or not to disable soft-delete for a particular vault depending on the scenario. For more information, see the [soft-delete article](backup-azure-security-feature-cloud.md#soft-delete).
19+
20+
### Fetch soft delete state using REST API
21+
22+
By default, the soft-delete state will be enabled for any newly created Recovery Services vault. To fetch/update the state of soft-delete for a vault, use the backup vault's config related [REST API document](https://docs.microsoft.com/rest/api/backup/backupresourcevaultconfigs)
23+
24+
To fetch the current state of soft-delete for a vault, use the following *GET* operation
25+
26+
```http
27+
GET https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig?api-version=2019-05-13
28+
```
29+
30+
The GET URI has `{subscriptionId}`, `{vaultName}`, `{vaultresourceGroupName}` parameters. In this example, `{vaultName}` is "testVault" and `{vaultresourceGroupName}` is "testVaultRG". As all the required parameters are given in the URI, there is no need for a separate request body.
31+
32+
```http
33+
GET https://management.azure.com/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVaultRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupconfig/vaultconfig?api-version=2019-05-13
34+
```
35+
36+
#### Responses
37+
38+
The successful response for the 'GET' operation is shown below:
39+
40+
|Name |Type |Description |
41+
|---------|---------|---------|
42+
|200 OK | [BackupResourceVaultConfig](https://docs.microsoft.com/rest/api/backup/backupresourcevaultconfigs/get#backupresourcevaultconfigresource) | OK |
43+
44+
##### Example response
45+
46+
Once the 'GET' request is submitted, a 200 (successful) response is returned.
47+
48+
```json
49+
{
50+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testvaultRG/providers/Microsoft.RecoveryServices/vaults/testvault/backupconfig/vaultconfig",
51+
"name": "vaultconfig",
52+
"type": "Microsoft.RecoveryServices/vaults/backupconfig",
53+
"properties": {
54+
"enhancedSecurityState": "Enabled",
55+
"softDeleteFeatureState": "Enabled"
56+
}
57+
}
58+
```
59+
60+
### Update soft delete state using REST API
61+
62+
To update the soft-delete state of the recovery services vault using REST API, use the following *PATCH* operation
63+
64+
```http
65+
PATCH https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig?api-version=2019-05-13
66+
```
67+
68+
The PATCH URI has `{subscriptionId}`, `{vaultName}`, `{vaultresourceGroupName}` parameters. In this example, `{vaultName}` is "testVault" and `{vaultresourceGroupName}` is "testVaultRG". If we replace the URI with the values above, then the URI will look like this.
69+
70+
```http
71+
PATCH https://management.azure.com/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVaultRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupconfig/vaultconfig?api-version=2019-05-13
72+
```
73+
74+
#### Create the request body
75+
76+
THe following common definitions are used to create a request body
77+
78+
For more details, refer to [the REST API documentation](https://docs.microsoft.com/rest/api/backup/backupresourcevaultconfigs/update#request-body)
79+
80+
|Name |Required |Type |Description |
81+
|---------|---------|---------|---------|
82+
|eTag | | String | Optional eTag |
83+
|location | true |String | Resource location |
84+
|properties | | [VaultProperties](https://docs.microsoft.com/rest/api/recoveryservices/vaults/createorupdate#vaultproperties) | Properties of the vault |
85+
|tags | | Object | Resource tags |
86+
87+
#### Example request body
88+
89+
The following example is used to update the soft-delete sate to 'disabled'.
90+
91+
```json
92+
{
93+
"properties": {
94+
"enhancedSecurityState": "Enabled",
95+
"softDeleteFeatureState": "Disabled"
96+
}
97+
}
98+
```
99+
100+
#### Responses
101+
102+
The successful response for the 'PATCH' operation is shown below:
103+
104+
|Name |Type |Description |
105+
|---------|---------|---------|
106+
|200 OK | [BackupResourceVaultConfig](https://docs.microsoft.com/rest/api/backup/backupresourcevaultconfigs/get#backupresourcevaultconfigresource) | OK |
107+
108+
##### Example response
109+
110+
Once the 'PATCH' request is submitted, a 200 (successful) response is returned.
111+
112+
```json
113+
{
114+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testvaultRG/providers/Microsoft.RecoveryServices/vaults/testvault/backupconfig/vaultconfig",
115+
"name": "vaultconfig",
116+
"type": "Microsoft.RecoveryServices/vaults/backupconfig",
117+
"properties": {
118+
"enhancedSecurityState": "Enabled",
119+
"softDeleteFeatureState": "Disabled"
120+
}
121+
}
122+
```
123+
124+
## Next steps
125+
126+
[Create a backup policy for backing up an Azure VM in this vault](backup-azure-arm-userestapi-createorupdatepolicy.md).
127+
128+
For more information on the Azure REST APIs, see the following documents:
129+
130+
- [Azure Recovery Services provider REST API](/rest/api/recoveryservices/)
131+
- [Get started with Azure REST API](/rest/api/azure/)

0 commit comments

Comments
 (0)