Backup Policies - Create Or Update
创建或更新属于备份保管库的备份策略
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}?api-version=2025-07-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
backup
|
path | True |
string |
策略的名称 |
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
subscription
|
path | True |
string (uuid) |
目标订阅的 ID。 该值必须是 UUID。 |
vault
|
path | True |
string |
备份保管库的名称。 |
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
请求正文
名称 | 类型 | 说明 |
---|---|---|
properties | BaseBackupPolicy: |
BaseBackupPolicy 的 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
好的 |
|
Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户。 |
示例
CreateOrUpdate BackupPolicy
示例请求
PUT https://management.azure.com/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PrivatePreviewVault/backupPolicies/OSSDBPolicy?api-version=2025-07-01
{
"properties": {
"policyRules": [
{
"backupParameters": {
"backupType": "Full",
"objectType": "AzureBackupParams"
},
"trigger": {
"schedule": {
"repeatingTimeIntervals": [
"R/2019-11-20T08:00:00-08:00/P1W"
]
},
"taggingCriteria": [
{
"tagInfo": {
"tagName": "Default"
},
"taggingPriority": 99,
"isDefault": true
},
{
"tagInfo": {
"tagName": "Weekly"
},
"taggingPriority": 20,
"isDefault": false,
"criteria": [
{
"scheduleTimes": [
"2019-03-01T13:00:00Z"
],
"daysOfTheWeek": [
"Sunday"
],
"objectType": "ScheduleBasedBackupCriteria"
}
]
}
],
"objectType": "ScheduleBasedTriggerContext"
},
"dataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"name": "BackupWeekly",
"objectType": "AzureBackupRule"
},
{
"lifecycles": [
{
"sourceDataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"deleteAfter": {
"objectType": "AbsoluteDeleteOption",
"duration": "P1W"
}
}
],
"isDefault": true,
"name": "Default",
"objectType": "AzureRetentionRule"
},
{
"lifecycles": [
{
"sourceDataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"deleteAfter": {
"objectType": "AbsoluteDeleteOption",
"duration": "P12W"
}
}
],
"isDefault": false,
"name": "Weekly",
"objectType": "AzureRetentionRule"
}
],
"datasourceTypes": [
"OssDB"
],
"objectType": "BackupPolicy"
}
}
示例响应
{
"id": "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PrivatePreviewVault/backupPolicies/OSSDBPolicy",
"name": "OSSDBPolicy",
"type": "Microsoft.DataProtection/backupVaults/backupPolicies",
"properties": {
"policyRules": [
{
"backupParameters": {
"backupType": "Full",
"objectType": "AzureBackupParams"
},
"trigger": {
"schedule": {
"repeatingTimeIntervals": [
"R/2019-11-20T08:00:00-08:00/P1W"
]
},
"taggingCriteria": [
{
"tagInfo": {
"tagName": "Default",
"id": "Default_"
},
"taggingPriority": 99,
"isDefault": true
},
{
"tagInfo": {
"tagName": "Weekly",
"id": "Weekly_"
},
"taggingPriority": 20,
"isDefault": false,
"criteria": [
{
"scheduleTimes": [
"2019-03-01T13:00:00Z"
],
"daysOfTheWeek": [
"Sunday"
],
"objectType": "ScheduleBasedBackupCriteria"
}
]
}
],
"objectType": "ScheduleBasedTriggerContext"
},
"dataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"name": "BackupWeekly",
"objectType": "AzureBackupRule"
},
{
"lifecycles": [
{
"sourceDataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"deleteAfter": {
"objectType": "AbsoluteDeleteOption",
"duration": "P1W"
}
}
],
"isDefault": true,
"name": "Default",
"objectType": "AzureRetentionRule"
},
{
"lifecycles": [
{
"sourceDataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"deleteAfter": {
"objectType": "AbsoluteDeleteOption",
"duration": "P12W"
}
}
],
"isDefault": false,
"name": "Weekly",
"objectType": "AzureRetentionRule"
}
],
"datasourceTypes": [
"OssDB"
],
"objectType": "BackupPolicy"
}
}
定义
名称 | 说明 |
---|---|
Absolute |
AbsoluteDeleteOption |
Absolute |
它包含绝对值,如“AllBackup”/“FirstOfDay”/“FirstOfWeek”/“FirstOfMonth”,应是 AbsoluteMarker 枚举的一部分 |
Adhoc |
AdhocBasedTaggingCriteria |
Adhoc |
AdhocBasedTriggerContext |
Azure |
AzureBackupParams |
Azure |
AzureBackupRule |
Azure |
AzureRetentionRule |
Backup |
备份策略 |
Backup |
备份计划 |
Base |
BaseBackupPolicyResource |
Cloud |
CloudError 错误 |
Copy |
CopyOnExpiry选项 |
created |
创建资源的标识的类型。 |
Custom |
CustomCopyOption |
Data |
数据存储信息库 |
Data |
数据存储的类型;作/保管库/存档 |
Day |
日期 |
Day |
它应该是星期日/星期一/T..../星期六 |
Error |
资源管理错误响应。 |
Error |
资源管理错误附加信息。 |
Immediate |
ImmediateCopyOption |
Month |
它应为 1 月/2 月/....../12 月 |
Retention |
RetentionTag |
Schedule |
ScheduleBasedBackupCriteria |
Schedule |
ScheduleBasedTriggerContext |
Source |
源生命周期 |
system |
与创建和上次修改资源相关的元数据。 |
Tagging |
标记标准 |
Target |
TargetCopySetting |
Week |
它应为 First/Second/Third/Fourth/Last |
AbsoluteDeleteOption
AbsoluteDeleteOption
名称 | 类型 | 说明 |
---|---|---|
duration |
string |
给定时间跨度后删除的持续时间 |
objectType | string: |
特定对象的类型 - 用于反序列化 |
AbsoluteMarker
它包含绝对值,如“AllBackup”/“FirstOfDay”/“FirstOfWeek”/“FirstOfMonth”,应是 AbsoluteMarker 枚举的一部分
值 | 说明 |
---|---|
AllBackup | |
FirstOfDay | |
FirstOfMonth | |
FirstOfWeek | |
FirstOfYear |
AdhocBasedTaggingCriteria
AdhocBasedTaggingCriteria
名称 | 类型 | 说明 |
---|---|---|
tagInfo |
RetentionTag |
AdhocBasedTriggerContext
AdhocBasedTriggerContext
名称 | 类型 | 说明 |
---|---|---|
objectType | string: |
特定对象的类型 - 用于反序列化 |
taggingCriteria |
AdhocBasedTaggingCriteria |
AzureBackupParams
AzureBackupParams
名称 | 类型 | 说明 |
---|---|---|
backupType |
string |
BackupType ;完整/增量等 |
objectType | string: |
特定对象的类型 - 用于反序列化 |
AzureBackupRule
AzureBackupRule
名称 | 类型 | 说明 |
---|---|---|
backupParameters | BackupParameters: |
BackupParameters |
dataStore |
数据存储信息库 |
|
name |
string |
|
objectType | string: | |
trigger | TriggerContext: |
TriggerContext (触发器上下文) |
AzureRetentionRule
AzureRetentionRule
名称 | 类型 | 说明 |
---|---|---|
isDefault |
boolean |
|
lifecycles |
源生命周期 |
|
name |
string |
|
objectType | string: |
BackupPolicy
备份策略
名称 | 类型 | 说明 |
---|---|---|
datasourceTypes |
string[] |
备份管理的数据源类型 |
objectType | string: | |
policyRules | BasePolicyRule[]: |
策略规则字典,其中包含每个备份类型的规则,即完整/增量/日志等 |
BackupSchedule
备份计划
名称 | 类型 | 说明 |
---|---|---|
repeatingTimeIntervals |
string[] |
ISO 8601 重复时间间隔格式 |
timeZone |
string |
计划的时区。 示例:太平洋标准时间 |
BaseBackupPolicyResource
BaseBackupPolicyResource
名称 | 类型 | 说明 |
---|---|---|
id |
string |
资源 ID 表示资源的完整路径。 |
name |
string |
与资源关联的资源名称。 |
properties | BaseBackupPolicy: |
BaseBackupPolicy 的 |
systemData |
与创建和上次修改资源相关的元数据。 |
|
type |
string |
资源类型表示命名空间/ResourceType/ResourceType/... |
CloudError
CloudError 错误
名称 | 类型 | 说明 |
---|---|---|
error |
资源管理错误响应。 |
CopyOnExpiryOption
CopyOnExpiry选项
名称 | 类型 | 说明 |
---|---|---|
objectType | string: |
特定对象的类型 - 用于反序列化 |
createdByType
创建资源的标识的类型。
值 | 说明 |
---|---|
Application | |
Key | |
ManagedIdentity | |
User |
CustomCopyOption
CustomCopyOption
名称 | 类型 | 说明 |
---|---|---|
duration |
string |
给定时间跨度后复制的数据 |
objectType | string: |
特定对象的类型 - 用于反序列化 |
DataStoreInfoBase
数据存储信息库
名称 | 类型 | 说明 |
---|---|---|
dataStoreType |
数据存储的类型;作/保管库/存档 |
|
objectType |
string |
Datasource 对象的类型,用于初始化正确的继承类型 |
DataStoreTypes
数据存储的类型;作/保管库/存档
值 | 说明 |
---|---|
ArchiveStore | |
OperationalStore | |
VaultStore |
Day
日期
名称 | 类型 | 说明 |
---|---|---|
date |
integer (int32) |
月份的日期 |
isLast |
boolean |
日期是否为月份的最后一个日期 |
DayOfWeek
它应该是星期日/星期一/T..../星期六
值 | 说明 |
---|---|
Friday | |
Monday | |
Saturday | |
Sunday | |
Thursday | |
Tuesday | |
Wednesday |
Error
资源管理错误响应。
名称 | 类型 | 说明 |
---|---|---|
additionalInfo |
错误附加信息。 |
|
code |
string |
错误代码。 |
details |
Error[] |
错误详细信息。 |
message |
string |
错误消息。 |
target |
string |
错误目标。 |
ErrorAdditionalInfo
资源管理错误附加信息。
名称 | 类型 | 说明 |
---|---|---|
info |
object |
其他信息。 |
type |
string |
其他信息类型。 |
ImmediateCopyOption
ImmediateCopyOption
名称 | 类型 | 说明 |
---|---|---|
objectType | string: |
特定对象的类型 - 用于反序列化 |
Month
它应为 1 月/2 月/....../12 月
值 | 说明 |
---|---|
April | |
August | |
December | |
February | |
January | |
July | |
June | |
March | |
May | |
November | |
October | |
September |
RetentionTag
RetentionTag
名称 | 类型 | 说明 |
---|---|---|
eTag |
string |
保留标记版本。 |
id |
string |
保留标记版本。 |
tagName |
string |
保留标记名称将其与保留规则相关联。 |
ScheduleBasedBackupCriteria
ScheduleBasedBackupCriteria
名称 | 类型 | 说明 |
---|---|---|
absoluteCriteria |
它包含绝对值,如“AllBackup”/“FirstOfDay”/“FirstOfWeek”/“FirstOfMonth”,应是 AbsoluteMarker 枚举的一部分 |
|
daysOfMonth |
Day[] |
这是一个月中的一天,从 1 到 28,否则为上个月 |
daysOfTheWeek |
它应该是星期日/星期一/T..../星期六 |
|
monthsOfYear |
Month[] |
它应为 1 月/2 月/....../12 月 |
objectType | string: |
特定对象的类型 - 用于反序列化 |
scheduleTimes |
string[] (date-time) |
备份计划时间列表 |
weeksOfTheMonth |
它应为 First/Second/Third/Fourth/Last |
ScheduleBasedTriggerContext
ScheduleBasedTriggerContext
名称 | 类型 | 说明 |
---|---|---|
objectType | string: |
特定对象的类型 - 用于反序列化 |
schedule |
备份计划 |
|
taggingCriteria |
可用于给定计划的标记列表。 |
SourceLifeCycle
源生命周期
名称 | 类型 | 说明 |
---|---|---|
deleteAfter | DeleteOption: |
DeleteOption |
sourceDataStore |
数据存储信息库 |
|
targetDataStoreCopySettings |
TargetCopySetting |
systemData
与创建和上次修改资源相关的元数据。
名称 | 类型 | 说明 |
---|---|---|
createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
createdBy |
string |
创建资源的标识。 |
createdByType |
创建资源的标识的类型。 |
|
lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
lastModifiedBy |
string |
上次修改资源的标识。 |
lastModifiedByType |
上次修改资源的标识的类型。 |
TaggingCriteria
标记标准
名称 | 类型 | 说明 |
---|---|---|
criteria | BackupCriteria[]: |
决定是否可以将标记应用于触发的备份的条件。 |
isDefault |
boolean |
指定标记是否为默认值。 |
tagInfo |
RetentionTag |
|
taggingPriority |
integer (int64) |
保留标记优先级。 |
TargetCopySetting
TargetCopySetting
名称 | 类型 | 说明 |
---|---|---|
copyAfter | CopyOption: |
复制选项 |
dataStore |
数据存储信息库 |
WeekNumber
它应为 First/Second/Third/Fourth/Last
值 | 说明 |
---|---|
First | |
Fourth | |
Last | |
Second | |
Third |