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-arm-userestapi-createorupdatepolicy.md
+23-14Lines changed: 23 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,23 @@
1
1
---
2
-
title: Create backup policies using REST API
2
+
title: Create backup policies via REST API in Azure Backup
3
3
description: In this article, you'll learn how to create and manage backup policies (schedule and retention) using REST API.
4
4
ms.topic: how-to
5
-
ms.date: 02/14/2023
5
+
ms.date: 02/21/2024
6
6
ms.assetid: 5ffc4115-0ae5-4b85-a18c-8a942f6d4870
7
7
ms.service: backup
8
+
ms.custom: engagement-fy24
8
9
author: AbhishekMallick-MS
9
10
ms.author: v-abhmallick
10
11
---
11
-
# Create Azure Recovery Services backup policies using REST API
12
+
# Create Azure Recovery Services backup policies by using REST API
12
13
13
-
The steps to create a backup policy for an Azure Recovery Services vault are outlined in the [policy REST API document](/rest/api/backup/protection-policies/create-or-update). Let's use this document as a reference to create a policy for Azure VM backup.
14
+
This article describes how to create policies for the backup of Azure VM, SQL database in Azure VM, SAP HANA database in Azure VM, and Azure File share.
15
+
16
+
Learn more about [creating or modifying a backup policy for an Azure Recovery Services vault by using REST API](/rest/api/backup/protection-policies/create-or-update).
14
17
15
18
## Create or update a policy
16
19
17
-
To create or update an Azure Backup policy, use the following *PUT* operation
20
+
To create or update an Azure Backup policy, use the following *PUT* operation.
18
21
19
22
```http
20
23
PUT https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}?api-version=2019-05-13
@@ -24,18 +27,22 @@ The `{policyName}` and `{vaultName}` are provided in the URI. Additional informa
24
27
25
28
## Create the request body
26
29
27
-
For example, to create a policy for Azure VM backup, following are the components of the request body.
30
+
If you want to create a policy for Azure VM backup, the request body needs to have the following components:
For the complete list of definitions in the request body, refer to the [backup policy REST API document](/rest/api/backup/protection-policies/create-or-update).
37
+
For the complete list of definitions in the request body, see the [backup policy REST API article](/rest/api/backup/protection-policies/create-or-update).
35
38
36
39
### Example request body
37
40
38
-
#### For Azure VM backup
41
+
This section provides the example request body to create policies for the backup of Azure VM, SQL database in Azure VM, SAP HANA database in Azure VM, and Azure File share.
42
+
43
+
**Choose a datasource**:
44
+
45
+
# [Azure VM](#tab/azure-vm)
39
46
40
47
The following request body defines a standard backup policy for Azure VM backups.
41
48
@@ -214,9 +221,9 @@ This policy:
214
221
215
222
216
223
217
-
#### For SQL in Azure VM backup
224
+
#[SQL in Azure VM](#tab/sql-in-azure-vm)
218
225
219
-
The following is an example request body for SQL in Azure VM backup.
226
+
The following request body defines the backup policy for SQL in Azure VM backup.
220
227
221
228
This policy:
222
229
@@ -400,9 +407,9 @@ The following is an example of a policy that takes a differential backup everyda
400
407
}
401
408
```
402
409
403
-
#### For SAP HANA in Azure VM backup
410
+
#[SAP HANA in Azure VM](#tab/sap-hana-in-azure-vm)
404
411
405
-
The following is an example request body for SQL in Azure VM backup.
412
+
The following request body defines the policy for SAP HANA database in Azure VM backup.
406
413
407
414
This policy:
408
415
@@ -622,9 +629,9 @@ The following is an example of a policy that takes a full backup once a week and
622
629
```
623
630
624
631
625
-
#### For Azure File share backup
632
+
#[Azure File share](#tab/azure-file-share)
626
633
627
-
The following is an example request body for Azure File share backup.
634
+
The following request body defines the policy for Azure File share backup.
628
635
629
636
This policy:
630
637
@@ -675,6 +682,8 @@ This policy:
675
682
676
683
677
684
685
+
---
686
+
678
687
## Responses
679
688
680
689
The backup policy creation/update is a [asynchronous operation](../azure-resource-manager/management/async-operations.md). It means this operation creates another operation that needs to be tracked separately.
0 commit comments