- Latest
- 2025-09-01
- 2025-07-01
- 2025-02-01
- 2025-01-01
- 2024-04-01
- 2024-03-01
- 2024-02-01-preview
- 2023-12-01
- 2023-11-01
- 2023-08-01-preview
- 2023-06-01-preview
- 2023-05-01
- 2023-04-01-preview
- 2023-01-01
- 2022-12-01
- 2022-11-01-preview
- 2022-10-01-preview
- 2022-09-01-preview
- 2022-05-01
- 2022-04-01
- 2022-03-31-preview
- 2022-03-01
- 2022-02-01-preview
- 2022-01-01
- 2021-12-01-preview
- 2021-10-01-preview
- 2021-07-01
- 2021-06-01-preview
- 2021-02-01-preview
- 2021-01-01
Bicep 資源定義
backupVaults/backupPolicies 資源類型可以使用目標作業來部署:
有關每個 API 版本中已更改屬性的清單,請參閱 更改紀錄。
資源格式
若要建立 Microsoft.DataProtection/backupVaults/backupPolicies 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.DataProtection/backupVaults/backupPolicies@2022-11-01-preview' = {
parent: resourceSymbolicName
name: 'string'
properties: {
datasourceTypes: [
'string'
]
objectType: 'string'
// For remaining properties, see BaseBackupPolicy objects
}
}
BasePolicyRule 物件
設置 objectType 屬性以指定物件的類型。
對於 AzureBackupRule,請使用:
{
backupParameters: {
objectType: 'string'
// For remaining properties, see BackupParameters objects
}
dataStore: {
dataStoreType: 'string'
objectType: 'string'
}
objectType: 'AzureBackupRule'
trigger: {
objectType: 'string'
// For remaining properties, see TriggerContext objects
}
}
對於 AzureRetentionRule,請使用:
{
isDefault: bool
lifecycles: [
{
deleteAfter: {
duration: 'string'
objectType: 'string'
// For remaining properties, see DeleteOption objects
}
sourceDataStore: {
dataStoreType: 'string'
objectType: 'string'
}
targetDataStoreCopySettings: [
{
copyAfter: {
objectType: 'string'
// For remaining properties, see CopyOption objects
}
dataStore: {
dataStoreType: 'string'
objectType: 'string'
}
}
]
}
]
objectType: 'AzureRetentionRule'
}
TriggerContext 物件
設置 objectType 屬性以指定物件的類型。
對於 AdhocBasedTriggerContext,請使用:
{
objectType: 'AdhocBasedTriggerContext'
taggingCriteria: {
tagInfo: {
tagName: 'string'
}
}
}
對於 ScheduleBasedTriggerContext,請使用:
{
objectType: 'ScheduleBasedTriggerContext'
schedule: {
repeatingTimeIntervals: [
'string'
]
timeZone: 'string'
}
taggingCriteria: [
{
criteria: [
{
objectType: 'string'
// For remaining properties, see BackupCriteria objects
}
]
isDefault: bool
taggingPriority: int
tagInfo: {
tagName: 'string'
}
}
]
}
BaseBackupPolicy 物件
設置 objectType 屬性以指定物件的類型。
對於 BackupPolicy,請使用:
{
objectType: 'BackupPolicy'
policyRules: [
{
name: 'string'
objectType: 'string'
// For remaining properties, see BasePolicyRule objects
}
]
}
CopyOption 物件
設置 objectType 屬性以指定物件的類型。
對於 CopyOnExpiryOption,請使用:
{
objectType: 'CopyOnExpiryOption'
}
對於 CustomCopyOption,請使用:
{
duration: 'string'
objectType: 'CustomCopyOption'
}
對於 ImmediateCopyOption,請使用:
{
objectType: 'ImmediateCopyOption'
}
BackupCriteria 物件
設置 objectType 屬性以指定物件的類型。
對於 ScheduleBasedBackupCriteria,請使用:
{
absoluteCriteria: [
'string'
]
daysOfMonth: [
{
date: int
isLast: bool
}
]
daysOfTheWeek: [
'string'
]
monthsOfYear: [
'string'
]
objectType: 'ScheduleBasedBackupCriteria'
scheduleTimes: [
'string'
]
weeksOfTheMonth: [
'string'
]
}
DeleteOption 物件
設置 objectType 屬性以指定物件的類型。
對於 AbsoluteDeleteOption,請使用:
{
objectType: 'AbsoluteDeleteOption'
}
BackupParameters 物件
設置 objectType 屬性以指定物件的類型。
對於 AzureBackupParams,請使用:
{
backupType: 'string'
objectType: 'AzureBackupParams'
}
屬性值
Microsoft.DataProtection/backupVaults/backupPolicies
| Name | Description | Value |
|---|---|---|
| name | 資源名稱 | 字串(必填) |
| 父代 | 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。 如需詳細資訊,請參閱 父資源外部的子資源。 |
類型為:backupVaults 的資源的符號名稱 |
| properties | BaseBackupPolicyResource 屬性 | BaseBackupPolicy |
AbsoluteDeleteOption
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'AbsoluteDeleteOption'(必需) |
AdhocBasedTaggingCriteria
| Name | Description | Value |
|---|---|---|
| tagInfo | 保留標記資訊 | RetentionTag |
AdhocBasedTriggerContext
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | “AdhocBasedTriggerContext”(必需) |
| taggingCriteria | 標記準則,其中包含臨機作備份的保留標記。 | AdhocBasedTaggingCriteria (必填) |
AzureBackupParams
| Name | Description | Value |
|---|---|---|
| backupType | BackupType ;完整/累加等 | 字串(必填) |
| objectType | 特定物件的類型 - 用於還原串行化 | “AzureBackupParams”(必需) |
AzureBackupRule
| Name | Description | Value |
|---|---|---|
| backupParameters | BackupParameters 基底 | BackupParameters |
| dataStore | DataStoreInfo 基底 | DataStoreInfoBase (必需) |
| objectType | “AzureBackupRule”(必需) | |
| 觸發 | 觸發程序內容 | TriggerContext (必需) |
AzureRetentionRule
| Name | Description | Value |
|---|---|---|
| isDefault | bool | |
| lifecycles | SourceLifeCycle[](必需) | |
| objectType | “AzureRetentionRule”(必需) |
BackupCriteria
| Name | Description | Value |
|---|---|---|
| objectType | 對於 類型 ScheduleBasedBackupCriteria,請設置為“ScheduleBasedBackupCriteria”。 | 'ScheduleBasedBackupCriteria'(必需) |
BackupParameters
| Name | Description | Value |
|---|---|---|
| objectType | 對於 AzureBackupParams 類型,設置為“AzureBackupParams”。 | “AzureBackupParams”(必需) |
BackupPolicy
| Name | Description | Value |
|---|---|---|
| objectType | 'BackupPolicy'(必需) | |
| policyRules | 原則規則字典,其中包含每個備份類型的規則,例如完整/累加/記錄等 | BasePolicyRule[](必需) |
BackupSchedule
| Name | Description | Value |
|---|---|---|
| repeatingTimeIntervals | 僅支援以下 ISO 8601 格式 [R/startDateTime/Duration] 的重複時間間隔。 範例:R/2007-03-01T13:00:00Z/P1Y2M10DT2H30M | string[](必需) |
| timeZone | 排程的時區。 範例:太平洋標準時間 | 字串 |
BaseBackupPolicy
| Name | Description | Value |
|---|---|---|
| datasourceTypes | 備份管理的數據源類型 | string[](必需) |
| objectType | 將BackupPolicy類型設置為「 BackupPolicy」。。 | 'BackupPolicy'(必需) |
BasePolicyRule
| Name | Description | Value |
|---|---|---|
| name | 字串(必填) | |
| objectType | 對於 AzureBackupRule 類型,設置為“AzureBackupRule”。 對於 AzureRetentionRule 類型,設置為“AzureRetentionRule”。 | 'AzureBackupRule' “AzureRetentionRule”(必需) |
CopyOnExpiryOption
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'CopyOnExpiryOption'(必需) |
CopyOption
| Name | Description | Value |
|---|---|---|
| objectType | 對於 類型 CopyOnExpiryOption,設置為“CopyOnExpiryOption”。 將類型 CustomCopyOption 設置為「CustomCopyOption」。 將 ImmediateCopyOption 類型設置為“ImmediateCopyOption”。 | 'CopyOnExpiryOption' 'CustomCopyOption' 'ImmediateCopyOption'(必需) |
CustomCopyOption
| Name | Description | Value |
|---|---|---|
| duration | 在指定時間範圍之後複製的數據 | 字串 |
| objectType | 特定物件的類型 - 用於還原串行化 | 'CustomCopyOption'(必填) |
DataStoreInfoBase
| Name | Description | Value |
|---|---|---|
| dataStoreType | 數據存放區的類型;Operational/Vault/Archive | 'ArchiveStore' 'OperationalStore' 'VaultStore'(必填) |
| objectType | Datasource 物件的類型,用來初始化正確的繼承類型 | 字串(必填) |
Day
| Name | Description | Value |
|---|---|---|
| date | 月份的日期 | int |
| isLast | Date 是否為月份的最後一個日期 | bool |
DeleteOption
| Name | Description | Value |
|---|---|---|
| duration | 指定時間範圍之後刪除的持續時間 | 字串(必填) |
| objectType | 對於類型 AbsoluteDeleteOption,設置為“AbsoluteDeleteOption”。 | 'AbsoluteDeleteOption'(必需) |
ImmediateCopyOption
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'ImmediateCopyOption'(必需) |
RetentionTag
| Name | Description | Value |
|---|---|---|
| tagName | 保留標記名稱,使其與保留規則相關聯。 | 字串(必填) |
ScheduleBasedBackupCriteria
| Name | Description | Value |
|---|---|---|
| absoluteCriteria | 它包含絕對值,例如 “AllBackup” / “FirstOfDay” / “FirstOfWeek” / “FirstOfMonth” 和應該是AbsoluteMarker列舉的一部分 |
包含任何的字串數組: 'AllBackup' 'FirstOfDay' 'FirstOfMonth' 'FirstOfWeek' 'FirstOfYear' |
| daysOfMonth | 這是當月 1 到 28 日的日期,否則為上個月 | Day[] |
| daysOfTheWeek | 應該是星期日/星期一/T..../星期六 | 包含任何的字串數組: 'Friday' 'Monday' 'Saturday' 'Sunday' 'Thursday' 'Tuesday' 'Wednesday' |
| monthsOfYear | 應該是 1 月/2 月/....../12 月 | 包含任何的字串數組: 'April' 'August' 'December' 'February' 'January' 'July' 'June' 'March' 'May' 'November' 'October' 'September' |
| objectType | 特定物件的類型 - 用於還原串行化 | 'ScheduleBasedBackupCriteria'(必需) |
| scheduleTimes | 備份的排程時間清單 | string[] |
| weeksOfTheMonth | 應該是 First/Second/Third/Fourth/Last | 包含任何的字串數組: 'First' 'Fourth' 'Last' 'Second' 'Third' |
ScheduleBasedTriggerContext
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'ScheduleBasedTriggerContext'(必需) |
| schedule | 此備份的排程 | BackupSchedule (必需) |
| taggingCriteria | 適用於指定排程的標記清單。 | TaggingCriteria[](必填) |
SourceLifeCycle
| Name | Description | Value |
|---|---|---|
| deleteAfter | 刪除選項 | DeleteOption (必需) |
| sourceDataStore | DataStoreInfo 基底 | DataStoreInfoBase (必需) |
| targetDataStoreCopySettings | TargetCopySetting[] |
TaggingCriteria
| Name | Description | Value |
|---|---|---|
| criteria | 決定標籤是否可以套用至觸發備份的準則。 | BackupCriteria[] |
| isDefault | 指定標籤是否為預設值。 | bool(必填) |
| taggingPriority | 保留標記優先順序。 | int(必填) |
| tagInfo | 保留標記資訊 | RetentionTag (必需) |
TargetCopySetting
| Name | Description | Value |
|---|---|---|
| copyAfter | 它可以是 CustomCopyOption 或 ImmediateCopyOption。 | CopyOption (必填) |
| dataStore | 目標數據存放區的資訊 | DataStoreInfoBase (必需) |
TriggerContext
| Name | Description | Value |
|---|---|---|
| objectType | 對於類型 AdhocBasedTriggerContext,設置為“AdhocBasedTriggerContext”。 對於 類型 ScheduleBasedTriggerContext,設置為“ScheduleBasedTriggerContext”。 | 'AdhocBasedTriggerContext' 'ScheduleBasedTriggerContext'(必需) |
使用範例
Azure 快速入門範例
下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。
| Bicep 檔 | Description |
|---|---|
| 透過備份保存庫建立磁碟和啟用保護 | 建立磁碟並透過備份保存庫啟用保護的範本 |
| 創建MySQL靈活伺服器並通過備份庫啟用保護 | 建立 MySQL 彈性伺服器的範本,並透過備份保存庫啟用保護 |
| 建立 PgFlex 伺服器 & 透過 Backup Vault 啟用保護 | 建立PostgreSQL彈性伺服器的範本,並透過備份保存庫啟用保護 |
| 建立記憶體帳戶並透過備份保存庫啟用保護 | 建立記憶體帳戶並透過備份保存庫啟用作業和保存庫備份的範本 |
ARM 樣本資源定義
backupVaults/backupPolicies 資源類型可以使用目標作業來部署:
有關每個 API 版本中已更改屬性的清單,請參閱 更改紀錄。
資源格式
若要建立 Microsoft.DataProtection/backupVaults/backupPolicies 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.DataProtection/backupVaults/backupPolicies",
"apiVersion": "2022-11-01-preview",
"name": "string",
"properties": {
"datasourceTypes": [ "string" ],
"objectType": "string"
// For remaining properties, see BaseBackupPolicy objects
}
}
BasePolicyRule 物件
設置 objectType 屬性以指定物件的類型。
對於 AzureBackupRule,請使用:
{
"backupParameters": {
"objectType": "string"
// For remaining properties, see BackupParameters objects
},
"dataStore": {
"dataStoreType": "string",
"objectType": "string"
},
"objectType": "AzureBackupRule",
"trigger": {
"objectType": "string"
// For remaining properties, see TriggerContext objects
}
}
對於 AzureRetentionRule,請使用:
{
"isDefault": "bool",
"lifecycles": [
{
"deleteAfter": {
"duration": "string",
"objectType": "string"
// For remaining properties, see DeleteOption objects
},
"sourceDataStore": {
"dataStoreType": "string",
"objectType": "string"
},
"targetDataStoreCopySettings": [
{
"copyAfter": {
"objectType": "string"
// For remaining properties, see CopyOption objects
},
"dataStore": {
"dataStoreType": "string",
"objectType": "string"
}
}
]
}
],
"objectType": "AzureRetentionRule"
}
TriggerContext 物件
設置 objectType 屬性以指定物件的類型。
對於 AdhocBasedTriggerContext,請使用:
{
"objectType": "AdhocBasedTriggerContext",
"taggingCriteria": {
"tagInfo": {
"tagName": "string"
}
}
}
對於 ScheduleBasedTriggerContext,請使用:
{
"objectType": "ScheduleBasedTriggerContext",
"schedule": {
"repeatingTimeIntervals": [ "string" ],
"timeZone": "string"
},
"taggingCriteria": [
{
"criteria": [ {
"objectType": "string"
// For remaining properties, see BackupCriteria objects
} ],
"isDefault": "bool",
"taggingPriority": "int",
"tagInfo": {
"tagName": "string"
}
}
]
}
BaseBackupPolicy 物件
設置 objectType 屬性以指定物件的類型。
對於 BackupPolicy,請使用:
{
"objectType": "BackupPolicy",
"policyRules": [ {
"name": "string",
"objectType": "string"
// For remaining properties, see BasePolicyRule objects
} ]
}
CopyOption 物件
設置 objectType 屬性以指定物件的類型。
對於 CopyOnExpiryOption,請使用:
{
"objectType": "CopyOnExpiryOption"
}
對於 CustomCopyOption,請使用:
{
"duration": "string",
"objectType": "CustomCopyOption"
}
對於 ImmediateCopyOption,請使用:
{
"objectType": "ImmediateCopyOption"
}
BackupCriteria 物件
設置 objectType 屬性以指定物件的類型。
對於 ScheduleBasedBackupCriteria,請使用:
{
"absoluteCriteria": [ "string" ],
"daysOfMonth": [
{
"date": "int",
"isLast": "bool"
}
],
"daysOfTheWeek": [ "string" ],
"monthsOfYear": [ "string" ],
"objectType": "ScheduleBasedBackupCriteria",
"scheduleTimes": [ "string" ],
"weeksOfTheMonth": [ "string" ]
}
DeleteOption 物件
設置 objectType 屬性以指定物件的類型。
對於 AbsoluteDeleteOption,請使用:
{
"objectType": "AbsoluteDeleteOption"
}
BackupParameters 物件
設置 objectType 屬性以指定物件的類型。
對於 AzureBackupParams,請使用:
{
"backupType": "string",
"objectType": "AzureBackupParams"
}
屬性值
Microsoft.DataProtection/backupVaults/backupPolicies
| Name | Description | Value |
|---|---|---|
| apiVersion | API 版本 | '2022-11-01-preview' |
| name | 資源名稱 | 字串(必填) |
| properties | BaseBackupPolicyResource 屬性 | BaseBackupPolicy |
| 型別 | 資源類型 | 'Microsoft.DataProtection/backupVaults/backupPolicies' |
AbsoluteDeleteOption
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'AbsoluteDeleteOption'(必需) |
AdhocBasedTaggingCriteria
| Name | Description | Value |
|---|---|---|
| tagInfo | 保留標記資訊 | RetentionTag |
AdhocBasedTriggerContext
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | “AdhocBasedTriggerContext”(必需) |
| taggingCriteria | 標記準則,其中包含臨機作備份的保留標記。 | AdhocBasedTaggingCriteria (必填) |
AzureBackupParams
| Name | Description | Value |
|---|---|---|
| backupType | BackupType ;完整/累加等 | 字串(必填) |
| objectType | 特定物件的類型 - 用於還原串行化 | “AzureBackupParams”(必需) |
AzureBackupRule
| Name | Description | Value |
|---|---|---|
| backupParameters | BackupParameters 基底 | BackupParameters |
| dataStore | DataStoreInfo 基底 | DataStoreInfoBase (必需) |
| objectType | “AzureBackupRule”(必需) | |
| 觸發 | 觸發程序內容 | TriggerContext (必需) |
AzureRetentionRule
| Name | Description | Value |
|---|---|---|
| isDefault | bool | |
| lifecycles | SourceLifeCycle[](必需) | |
| objectType | “AzureRetentionRule”(必需) |
BackupCriteria
| Name | Description | Value |
|---|---|---|
| objectType | 對於 類型 ScheduleBasedBackupCriteria,請設置為“ScheduleBasedBackupCriteria”。 | 'ScheduleBasedBackupCriteria'(必需) |
BackupParameters
| Name | Description | Value |
|---|---|---|
| objectType | 對於 AzureBackupParams 類型,設置為“AzureBackupParams”。 | “AzureBackupParams”(必需) |
BackupPolicy
| Name | Description | Value |
|---|---|---|
| objectType | 'BackupPolicy'(必需) | |
| policyRules | 原則規則字典,其中包含每個備份類型的規則,例如完整/累加/記錄等 | BasePolicyRule[](必需) |
BackupSchedule
| Name | Description | Value |
|---|---|---|
| repeatingTimeIntervals | 僅支援以下 ISO 8601 格式 [R/startDateTime/Duration] 的重複時間間隔。 範例:R/2007-03-01T13:00:00Z/P1Y2M10DT2H30M | string[](必需) |
| timeZone | 排程的時區。 範例:太平洋標準時間 | 字串 |
BaseBackupPolicy
| Name | Description | Value |
|---|---|---|
| datasourceTypes | 備份管理的數據源類型 | string[](必需) |
| objectType | 將BackupPolicy類型設置為「 BackupPolicy」。。 | 'BackupPolicy'(必需) |
BasePolicyRule
| Name | Description | Value |
|---|---|---|
| name | 字串(必填) | |
| objectType | 對於 AzureBackupRule 類型,設置為“AzureBackupRule”。 對於 AzureRetentionRule 類型,設置為“AzureRetentionRule”。 | 'AzureBackupRule' “AzureRetentionRule”(必需) |
CopyOnExpiryOption
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'CopyOnExpiryOption'(必需) |
CopyOption
| Name | Description | Value |
|---|---|---|
| objectType | 對於 類型 CopyOnExpiryOption,設置為“CopyOnExpiryOption”。 將類型 CustomCopyOption 設置為「CustomCopyOption」。 將 ImmediateCopyOption 類型設置為“ImmediateCopyOption”。 | 'CopyOnExpiryOption' 'CustomCopyOption' 'ImmediateCopyOption'(必需) |
CustomCopyOption
| Name | Description | Value |
|---|---|---|
| duration | 在指定時間範圍之後複製的數據 | 字串 |
| objectType | 特定物件的類型 - 用於還原串行化 | 'CustomCopyOption'(必填) |
DataStoreInfoBase
| Name | Description | Value |
|---|---|---|
| dataStoreType | 數據存放區的類型;Operational/Vault/Archive | 'ArchiveStore' 'OperationalStore' 'VaultStore'(必填) |
| objectType | Datasource 物件的類型,用來初始化正確的繼承類型 | 字串(必填) |
Day
| Name | Description | Value |
|---|---|---|
| date | 月份的日期 | int |
| isLast | Date 是否為月份的最後一個日期 | bool |
DeleteOption
| Name | Description | Value |
|---|---|---|
| duration | 指定時間範圍之後刪除的持續時間 | 字串(必填) |
| objectType | 對於類型 AbsoluteDeleteOption,設置為“AbsoluteDeleteOption”。 | 'AbsoluteDeleteOption'(必需) |
ImmediateCopyOption
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'ImmediateCopyOption'(必需) |
RetentionTag
| Name | Description | Value |
|---|---|---|
| tagName | 保留標記名稱,使其與保留規則相關聯。 | 字串(必填) |
ScheduleBasedBackupCriteria
| Name | Description | Value |
|---|---|---|
| absoluteCriteria | 它包含絕對值,例如 “AllBackup” / “FirstOfDay” / “FirstOfWeek” / “FirstOfMonth” 和應該是AbsoluteMarker列舉的一部分 |
包含任何的字串數組: 'AllBackup' 'FirstOfDay' 'FirstOfMonth' 'FirstOfWeek' 'FirstOfYear' |
| daysOfMonth | 這是當月 1 到 28 日的日期,否則為上個月 | Day[] |
| daysOfTheWeek | 應該是星期日/星期一/T..../星期六 | 包含任何的字串數組: 'Friday' 'Monday' 'Saturday' 'Sunday' 'Thursday' 'Tuesday' 'Wednesday' |
| monthsOfYear | 應該是 1 月/2 月/....../12 月 | 包含任何的字串數組: 'April' 'August' 'December' 'February' 'January' 'July' 'June' 'March' 'May' 'November' 'October' 'September' |
| objectType | 特定物件的類型 - 用於還原串行化 | 'ScheduleBasedBackupCriteria'(必需) |
| scheduleTimes | 備份的排程時間清單 | string[] |
| weeksOfTheMonth | 應該是 First/Second/Third/Fourth/Last | 包含任何的字串數組: 'First' 'Fourth' 'Last' 'Second' 'Third' |
ScheduleBasedTriggerContext
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'ScheduleBasedTriggerContext'(必需) |
| schedule | 此備份的排程 | BackupSchedule (必需) |
| taggingCriteria | 適用於指定排程的標記清單。 | TaggingCriteria[](必填) |
SourceLifeCycle
| Name | Description | Value |
|---|---|---|
| deleteAfter | 刪除選項 | DeleteOption (必需) |
| sourceDataStore | DataStoreInfo 基底 | DataStoreInfoBase (必需) |
| targetDataStoreCopySettings | TargetCopySetting[] |
TaggingCriteria
| Name | Description | Value |
|---|---|---|
| criteria | 決定標籤是否可以套用至觸發備份的準則。 | BackupCriteria[] |
| isDefault | 指定標籤是否為預設值。 | bool(必填) |
| taggingPriority | 保留標記優先順序。 | int(必填) |
| tagInfo | 保留標記資訊 | RetentionTag (必需) |
TargetCopySetting
| Name | Description | Value |
|---|---|---|
| copyAfter | 它可以是 CustomCopyOption 或 ImmediateCopyOption。 | CopyOption (必填) |
| dataStore | 目標數據存放區的資訊 | DataStoreInfoBase (必需) |
TriggerContext
| Name | Description | Value |
|---|---|---|
| objectType | 對於類型 AdhocBasedTriggerContext,設置為“AdhocBasedTriggerContext”。 對於 類型 ScheduleBasedTriggerContext,設置為“ScheduleBasedTriggerContext”。 | 'AdhocBasedTriggerContext' 'ScheduleBasedTriggerContext'(必需) |
使用範例
Azure 快速入門範本
下列 Azure 快速入門範本 部署此資源類型。
| Template | Description |
|---|---|
|
透過備份保存庫建立磁碟和啟用保護 |
建立磁碟並透過備份保存庫啟用保護的範本 |
|
創建MySQL靈活伺服器並通過備份庫啟用保護 |
建立 MySQL 彈性伺服器的範本,並透過備份保存庫啟用保護 |
|
建立 PgFlex 伺服器 & 透過 Backup Vault 啟用保護 |
建立PostgreSQL彈性伺服器的範本,並透過備份保存庫啟用保護 |
|
建立記憶體帳戶並透過備份保存庫啟用保護 |
建立記憶體帳戶並透過備份保存庫啟用作業和保存庫備份的範本 |
Terraform (AzAPI 提供者) 資源定義
backupVaults/backupPolicies 資源類型可以使用目標作業來部署:
有關每個 API 版本中已更改屬性的清單,請參閱 更改紀錄。
資源格式
若要建立 Microsoft.DataProtection/backupVaults/backupPolicies 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DataProtection/backupVaults/backupPolicies@2022-11-01-preview"
name = "string"
parent_id = "string"
body = {
properties = {
datasourceTypes = [
"string"
]
objectType = "string"
// For remaining properties, see BaseBackupPolicy objects
}
}
}
BasePolicyRule 物件
設置 objectType 屬性以指定物件的類型。
對於 AzureBackupRule,請使用:
{
backupParameters = {
objectType = "string"
// For remaining properties, see BackupParameters objects
}
dataStore = {
dataStoreType = "string"
objectType = "string"
}
objectType = "AzureBackupRule"
trigger = {
objectType = "string"
// For remaining properties, see TriggerContext objects
}
}
對於 AzureRetentionRule,請使用:
{
isDefault = bool
lifecycles = [
{
deleteAfter = {
duration = "string"
objectType = "string"
// For remaining properties, see DeleteOption objects
}
sourceDataStore = {
dataStoreType = "string"
objectType = "string"
}
targetDataStoreCopySettings = [
{
copyAfter = {
objectType = "string"
// For remaining properties, see CopyOption objects
}
dataStore = {
dataStoreType = "string"
objectType = "string"
}
}
]
}
]
objectType = "AzureRetentionRule"
}
TriggerContext 物件
設置 objectType 屬性以指定物件的類型。
對於 AdhocBasedTriggerContext,請使用:
{
objectType = "AdhocBasedTriggerContext"
taggingCriteria = {
tagInfo = {
tagName = "string"
}
}
}
對於 ScheduleBasedTriggerContext,請使用:
{
objectType = "ScheduleBasedTriggerContext"
schedule = {
repeatingTimeIntervals = [
"string"
]
timeZone = "string"
}
taggingCriteria = [
{
criteria = [
{
objectType = "string"
// For remaining properties, see BackupCriteria objects
}
]
isDefault = bool
taggingPriority = int
tagInfo = {
tagName = "string"
}
}
]
}
BaseBackupPolicy 物件
設置 objectType 屬性以指定物件的類型。
對於 BackupPolicy,請使用:
{
objectType = "BackupPolicy"
policyRules = [
{
name = "string"
objectType = "string"
// For remaining properties, see BasePolicyRule objects
}
]
}
CopyOption 物件
設置 objectType 屬性以指定物件的類型。
對於 CopyOnExpiryOption,請使用:
{
objectType = "CopyOnExpiryOption"
}
對於 CustomCopyOption,請使用:
{
duration = "string"
objectType = "CustomCopyOption"
}
對於 ImmediateCopyOption,請使用:
{
objectType = "ImmediateCopyOption"
}
BackupCriteria 物件
設置 objectType 屬性以指定物件的類型。
對於 ScheduleBasedBackupCriteria,請使用:
{
absoluteCriteria = [
"string"
]
daysOfMonth = [
{
date = int
isLast = bool
}
]
daysOfTheWeek = [
"string"
]
monthsOfYear = [
"string"
]
objectType = "ScheduleBasedBackupCriteria"
scheduleTimes = [
"string"
]
weeksOfTheMonth = [
"string"
]
}
DeleteOption 物件
設置 objectType 屬性以指定物件的類型。
對於 AbsoluteDeleteOption,請使用:
{
objectType = "AbsoluteDeleteOption"
}
BackupParameters 物件
設置 objectType 屬性以指定物件的類型。
對於 AzureBackupParams,請使用:
{
backupType = "string"
objectType = "AzureBackupParams"
}
屬性值
Microsoft.DataProtection/backupVaults/backupPolicies
| Name | Description | Value |
|---|---|---|
| name | 資源名稱 | 字串(必填) |
| parent_id | 此資源為父系之資源的標識碼。 | 類型為:backupVaults 的資源ID |
| properties | BaseBackupPolicyResource 屬性 | BaseBackupPolicy |
| 型別 | 資源類型 | "Microsoft.DataProtection/backupVaults/backupPolicies@2022-11-01-preview" |
AbsoluteDeleteOption
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'AbsoluteDeleteOption'(必需) |
AdhocBasedTaggingCriteria
| Name | Description | Value |
|---|---|---|
| tagInfo | 保留標記資訊 | RetentionTag |
AdhocBasedTriggerContext
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | “AdhocBasedTriggerContext”(必需) |
| taggingCriteria | 標記準則,其中包含臨機作備份的保留標記。 | AdhocBasedTaggingCriteria (必填) |
AzureBackupParams
| Name | Description | Value |
|---|---|---|
| backupType | BackupType ;完整/累加等 | 字串(必填) |
| objectType | 特定物件的類型 - 用於還原串行化 | “AzureBackupParams”(必需) |
AzureBackupRule
| Name | Description | Value |
|---|---|---|
| backupParameters | BackupParameters 基底 | BackupParameters |
| dataStore | DataStoreInfo 基底 | DataStoreInfoBase (必需) |
| objectType | “AzureBackupRule”(必需) | |
| 觸發 | 觸發程序內容 | TriggerContext (必需) |
AzureRetentionRule
| Name | Description | Value |
|---|---|---|
| isDefault | bool | |
| lifecycles | SourceLifeCycle[](必需) | |
| objectType | “AzureRetentionRule”(必需) |
BackupCriteria
| Name | Description | Value |
|---|---|---|
| objectType | 對於 類型 ScheduleBasedBackupCriteria,請設置為“ScheduleBasedBackupCriteria”。 | 'ScheduleBasedBackupCriteria'(必需) |
BackupParameters
| Name | Description | Value |
|---|---|---|
| objectType | 對於 AzureBackupParams 類型,設置為“AzureBackupParams”。 | “AzureBackupParams”(必需) |
BackupPolicy
| Name | Description | Value |
|---|---|---|
| objectType | 'BackupPolicy'(必需) | |
| policyRules | 原則規則字典,其中包含每個備份類型的規則,例如完整/累加/記錄等 | BasePolicyRule[](必需) |
BackupSchedule
| Name | Description | Value |
|---|---|---|
| repeatingTimeIntervals | 僅支援以下 ISO 8601 格式 [R/startDateTime/Duration] 的重複時間間隔。 範例:R/2007-03-01T13:00:00Z/P1Y2M10DT2H30M | string[](必需) |
| timeZone | 排程的時區。 範例:太平洋標準時間 | 字串 |
BaseBackupPolicy
| Name | Description | Value |
|---|---|---|
| datasourceTypes | 備份管理的數據源類型 | string[](必需) |
| objectType | 將BackupPolicy類型設置為「 BackupPolicy」。。 | 'BackupPolicy'(必需) |
BasePolicyRule
| Name | Description | Value |
|---|---|---|
| name | 字串(必填) | |
| objectType | 對於 AzureBackupRule 類型,設置為“AzureBackupRule”。 對於 AzureRetentionRule 類型,設置為“AzureRetentionRule”。 | 'AzureBackupRule' “AzureRetentionRule”(必需) |
CopyOnExpiryOption
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'CopyOnExpiryOption'(必需) |
CopyOption
| Name | Description | Value |
|---|---|---|
| objectType | 對於 類型 CopyOnExpiryOption,設置為“CopyOnExpiryOption”。 將類型 CustomCopyOption 設置為「CustomCopyOption」。 將 ImmediateCopyOption 類型設置為“ImmediateCopyOption”。 | 'CopyOnExpiryOption' 'CustomCopyOption' 'ImmediateCopyOption'(必需) |
CustomCopyOption
| Name | Description | Value |
|---|---|---|
| duration | 在指定時間範圍之後複製的數據 | 字串 |
| objectType | 特定物件的類型 - 用於還原串行化 | 'CustomCopyOption'(必填) |
DataStoreInfoBase
| Name | Description | Value |
|---|---|---|
| dataStoreType | 數據存放區的類型;Operational/Vault/Archive | 'ArchiveStore' 'OperationalStore' 'VaultStore'(必填) |
| objectType | Datasource 物件的類型,用來初始化正確的繼承類型 | 字串(必填) |
Day
| Name | Description | Value |
|---|---|---|
| date | 月份的日期 | int |
| isLast | Date 是否為月份的最後一個日期 | bool |
DeleteOption
| Name | Description | Value |
|---|---|---|
| duration | 指定時間範圍之後刪除的持續時間 | 字串(必填) |
| objectType | 對於類型 AbsoluteDeleteOption,設置為“AbsoluteDeleteOption”。 | 'AbsoluteDeleteOption'(必需) |
ImmediateCopyOption
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'ImmediateCopyOption'(必需) |
RetentionTag
| Name | Description | Value |
|---|---|---|
| tagName | 保留標記名稱,使其與保留規則相關聯。 | 字串(必填) |
ScheduleBasedBackupCriteria
| Name | Description | Value |
|---|---|---|
| absoluteCriteria | 它包含絕對值,例如 “AllBackup” / “FirstOfDay” / “FirstOfWeek” / “FirstOfMonth” 和應該是AbsoluteMarker列舉的一部分 |
包含任何的字串數組: 'AllBackup' 'FirstOfDay' 'FirstOfMonth' 'FirstOfWeek' 'FirstOfYear' |
| daysOfMonth | 這是當月 1 到 28 日的日期,否則為上個月 | Day[] |
| daysOfTheWeek | 應該是星期日/星期一/T..../星期六 | 包含任何的字串數組: 'Friday' 'Monday' 'Saturday' 'Sunday' 'Thursday' 'Tuesday' 'Wednesday' |
| monthsOfYear | 應該是 1 月/2 月/....../12 月 | 包含任何的字串數組: 'April' 'August' 'December' 'February' 'January' 'July' 'June' 'March' 'May' 'November' 'October' 'September' |
| objectType | 特定物件的類型 - 用於還原串行化 | 'ScheduleBasedBackupCriteria'(必需) |
| scheduleTimes | 備份的排程時間清單 | string[] |
| weeksOfTheMonth | 應該是 First/Second/Third/Fourth/Last | 包含任何的字串數組: 'First' 'Fourth' 'Last' 'Second' 'Third' |
ScheduleBasedTriggerContext
| Name | Description | Value |
|---|---|---|
| objectType | 特定物件的類型 - 用於還原串行化 | 'ScheduleBasedTriggerContext'(必需) |
| schedule | 此備份的排程 | BackupSchedule (必需) |
| taggingCriteria | 適用於指定排程的標記清單。 | TaggingCriteria[](必填) |
SourceLifeCycle
| Name | Description | Value |
|---|---|---|
| deleteAfter | 刪除選項 | DeleteOption (必需) |
| sourceDataStore | DataStoreInfo 基底 | DataStoreInfoBase (必需) |
| targetDataStoreCopySettings | TargetCopySetting[] |
TaggingCriteria
| Name | Description | Value |
|---|---|---|
| criteria | 決定標籤是否可以套用至觸發備份的準則。 | BackupCriteria[] |
| isDefault | 指定標籤是否為預設值。 | bool(必填) |
| taggingPriority | 保留標記優先順序。 | int(必填) |
| tagInfo | 保留標記資訊 | RetentionTag (必需) |
TargetCopySetting
| Name | Description | Value |
|---|---|---|
| copyAfter | 它可以是 CustomCopyOption 或 ImmediateCopyOption。 | CopyOption (必填) |
| dataStore | 目標數據存放區的資訊 | DataStoreInfoBase (必需) |
TriggerContext
| Name | Description | Value |
|---|---|---|
| objectType | 對於類型 AdhocBasedTriggerContext,設置為“AdhocBasedTriggerContext”。 對於 類型 ScheduleBasedTriggerContext,設置為“ScheduleBasedTriggerContext”。 | 'AdhocBasedTriggerContext' 'ScheduleBasedTriggerContext'(必需) |
使用範例
Terraform 範例
部署備份原則的基本範例。
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "backupVault" {
type = "Microsoft.DataProtection/backupVaults@2022-04-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
storageSettings = [
{
datastoreType = "VaultStore"
type = "LocallyRedundant"
},
]
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "backupPolicy" {
type = "Microsoft.DataProtection/backupVaults/backupPolicies@2022-04-01"
parent_id = azapi_resource.backupVault.id
name = var.resource_name
body = {
properties = {
datasourceTypes = [
"Microsoft.DBforPostgreSQL/servers/databases",
]
objectType = "BackupPolicy"
policyRules = [
{
backupParameters = {
backupType = "Full"
objectType = "AzureBackupParams"
}
dataStore = {
dataStoreType = "VaultStore"
objectType = "DataStoreInfoBase"
}
name = "BackupIntervals"
objectType = "AzureBackupRule"
trigger = {
objectType = "ScheduleBasedTriggerContext"
schedule = {
repeatingTimeIntervals = [
"R/2021-05-23T02:30:00+00:00/P1W",
]
}
taggingCriteria = [
{
isDefault = true
tagInfo = {
id = "Default_"
tagName = "Default"
}
taggingPriority = 99
},
]
}
},
{
isDefault = true
lifecycles = [
{
deleteAfter = {
duration = "P4M"
objectType = "AbsoluteDeleteOption"
}
sourceDataStore = {
dataStoreType = "VaultStore"
objectType = "DataStoreInfoBase"
}
targetDataStoreCopySettings = [
]
},
]
name = "Default"
objectType = "AzureRetentionRule"
},
]
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}