共用方式為


Microsoft.Chaos 實驗

Bicep 資源定義

實驗資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.Chaos/實驗資源,請將下列 Bicep 新增至您的範本。

resource symbolicname 'Microsoft.Chaos/experiments@2025-01-01' = {
  identity: {
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {}
    }
  }
  location: 'string'
  name: 'string'
  properties: {
    selectors: [
      {
        filter: {
          type: 'string'
          // For remaining properties, see ChaosTargetFilter objects
        }
        id: 'string'
        type: 'string'
        // For remaining properties, see ChaosTargetSelector objects
      }
    ]
    steps: [
      {
        branches: [
          {
            actions: [
              {
                name: 'string'
                type: 'string'
                // For remaining properties, see ChaosExperimentAction objects
              }
            ]
            name: 'string'
          }
        ]
        name: 'string'
      }
    ]
  }
  tags: {
    {customized property}: 'string'
  }
}

ChaosTargetFilter 物件

設定 類型 屬性,以指定物件的類型。

針對 [簡單],請使用:

{
  parameters: {
    zones: [
      'string'
    ]
  }
  type: 'Simple'
}

ChaosExperimentAction 物件

設定 類型 屬性,以指定物件的類型。

針對連續 ,請使用:

{
  duration: 'string'
  parameters: [
    {
      key: 'string'
      value: 'string'
    }
  ]
  selectorId: 'string'
  type: 'continuous'
}

針對 延遲,請使用:

{
  duration: 'string'
  type: 'delay'
}

針對 離散,請使用:

{
  parameters: [
    {
      key: 'string'
      value: 'string'
    }
  ]
  selectorId: 'string'
  type: 'discrete'
}

ChaosTargetSelector 物件

設定 類型 屬性,以指定物件的類型。

針對 [列表],請使用:

{
  targets: [
    {
      id: 'string'
      type: 'string'
    }
  ]
  type: 'List'
}

針對 [查詢],請使用:

{
  queryString: 'string'
  subscriptionIds: [
    'string'
  ]
  type: 'Query'
}

屬性值

Microsoft.Chaos/實驗

名稱 說明 價值觀
身分識別 指派給此資源的受控服務識別。 ManagedServiceIdentity
位置 資源所在的地理位置 字串 (必要)
名稱 資源名稱 字串

約束:
最小長度 = 1
模式 = ^[^<>%&:?#/\\]+$ (必要)
屬性 實驗資源的屬性。 ExperimentProperties (必要)
標記 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤

ChaosExperimentAction

名稱 說明 價值觀
名稱 表示功能 URN 的字串。 字串

約束:
最大長度 = 2048 (必要)
型別 將 類型設定為 'continuous',ContinuousAction。 針對 delayAction 類型設定為 'delay' DelayAction。 設定為 'discrete' 類型 DiscreteAction '連續'
'延遲'
'discrete' (必要)

ChaosExperimentBranch

名稱 說明 價值觀
行為 動作清單。 ChaosExperimentAction[] (必要)
名稱 分支名稱的字串。 字串

約束:
最小長度 = 1 (必要)

ChaosExperimentStep

名稱 說明 價值觀
分支 分支清單。 ChaosExperimentBranch[] (必要)
名稱 步驟名稱的字串。 字串

約束:
最小長度 = 1 (必要)

ChaosTargetFilter

名稱 說明 價值觀
型別 設定為 ChaosTargetSimpleFilter 類型的 'Simple'。 'Simple' (必要)

ChaosTargetListSelector

名稱 說明 價值觀
目標 目標參考清單。 TargetReference[] (必要)
型別 混亂目標選取器歧視性類型 'List' (必要)

ChaosTargetQuerySelector

名稱 說明 價值觀
queryString 查詢字串 目標資源的 Azure Resource Graph (ARG) 查詢語言查詢。 字串 (必要)
subscriptionIds 訂閱ID 範圍資源查詢的訂用帳戶標識碼清單。 string[] (必要)
型別 混亂目標選取器歧視性類型 'Query' (必要)

ChaosTargetSelector

名稱 說明 價值觀
篩選 模型,表示可套用至目標清單的可用篩選類型。 ChaosTargetFilter
識別碼 選取器識別碼的字串。 字串

約束:
最小長度 = 1 (必要)
型別 設定為 ChaosTargetListSelector 類型的 'List'。 設定為 ChaosTargetQuerySelector 類型的 『Query』。 '清單'
'Query' (必要)

ChaosTargetSimpleFilter

名稱 說明 價值觀
參數 代表簡單篩選參數的模型。 ChaosTargetSimpleFilterParameters
型別 Chaos 目標篩選歧視性類型 'Simple' (必要)

ChaosTargetSimpleFilterParameters

名稱 說明 價值觀
區域 要篩選目標的 Azure 可用性區域清單。 字串[]

連續作

名稱 說明 價值觀
持續時間 ISO8601表示持續時間的格式化字串。 字串 (必要)
參數 索引鍵值組的清單。 KeyValuePair[] (必要)
選擇器ID 表示選取器的字串。 字串

約束:
最小長度 = 1 (必要)
型別 混亂實驗動作歧視性類型 'continuous' (必要)

DelayAction (延遲作)

名稱 說明 價值觀
持續時間 ISO8601表示持續時間的格式化字串。 字串 (必要)
型別 混亂實驗動作歧視性類型 'delay' (必要)

離散作

名稱 說明 價值觀
參數 索引鍵值組的清單。 KeyValuePair[] (必要)
選擇器ID 表示選取器的字串。 字串

約束:
最小長度 = 1 (必要)
型別 混亂實驗動作歧視性類型 'discrete' (必要)

實驗屬性

名稱 說明 價值觀
選擇器 選取器清單。 ChaosTargetSelector[] (必要)
步驟 步驟清單。 ChaosExperimentStep[] (必要)

KeyValuePair 鍵值對

名稱 說明 價值觀
Key 動作的設定名稱。 字串

約束:
最小長度 = 1 (必要)
價值 動作設定的值。 字串

約束:
最小長度 = 1 (必要)

ManagedServiceIdentity

名稱 說明 價值觀
型別 受控服務識別的類型(允許 SystemAssigned 和 UserAssigned 類型)。 “無”
“系統分配”
'SystemAssigned,UserAssigned'
'UserAssigned' (必要)
使用者指派的身份 與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中的空白物件 ({})。 UserAssignedIdentities

目標引用

名稱 說明 價值觀
識別碼 目標資源的資源識別符字串。 字串 (必要)
型別 目標參考類型的列舉。 'ChaosTarget' (必要)

TrackedResourceTags

名稱 說明 價值觀

UserAssignedIdentities

名稱 說明 價值觀

UserAssignedIdentity

名稱 說明 價值觀

ARM 樣本資源定義

實驗資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.Chaos/實驗資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.Chaos/experiments",
  "apiVersion": "2025-01-01",
  "name": "string",
  "identity": {
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {
      }
    }
  },
  "location": "string",
  "properties": {
    "selectors": [ {
      "filter": {
        "type": "string"
        // For remaining properties, see ChaosTargetFilter objects
      },
      "id": "string",
      "type": "string"
      // For remaining properties, see ChaosTargetSelector objects
    } ],
    "steps": [
      {
        "branches": [
          {
            "actions": [ {
              "name": "string",
              "type": "string"
              // For remaining properties, see ChaosExperimentAction objects
            } ],
            "name": "string"
          }
        ],
        "name": "string"
      }
    ]
  },
  "tags": {
    "{customized property}": "string"
  }
}

ChaosTargetFilter 物件

設定 類型 屬性,以指定物件的類型。

針對 [簡單],請使用:

{
  "parameters": {
    "zones": [ "string" ]
  },
  "type": "Simple"
}

ChaosExperimentAction 物件

設定 類型 屬性,以指定物件的類型。

針對連續 ,請使用:

{
  "duration": "string",
  "parameters": [
    {
      "key": "string",
      "value": "string"
    }
  ],
  "selectorId": "string",
  "type": "continuous"
}

針對 延遲,請使用:

{
  "duration": "string",
  "type": "delay"
}

針對 離散,請使用:

{
  "parameters": [
    {
      "key": "string",
      "value": "string"
    }
  ],
  "selectorId": "string",
  "type": "discrete"
}

ChaosTargetSelector 物件

設定 類型 屬性,以指定物件的類型。

針對 [列表],請使用:

{
  "targets": [
    {
      "id": "string",
      "type": "string"
    }
  ],
  "type": "List"
}

針對 [查詢],請使用:

{
  "queryString": "string",
  "subscriptionIds": [ "string" ],
  "type": "Query"
}

屬性值

Microsoft.Chaos/實驗

名稱 說明 價值觀
apiVersion API 版本 '2025-01-01'
身分識別 指派給此資源的受控服務識別。 ManagedServiceIdentity
位置 資源所在的地理位置 字串 (必要)
名稱 資源名稱 字串

約束:
最小長度 = 1
模式 = ^[^<>%&:?#/\\]+$ (必要)
屬性 實驗資源的屬性。 ExperimentProperties (必要)
標記 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤
型別 資源類型 “Microsoft.Chaos/experiments”

ChaosExperimentAction

名稱 說明 價值觀
名稱 表示功能 URN 的字串。 字串

約束:
最大長度 = 2048 (必要)
型別 將 類型設定為 'continuous',ContinuousAction。 針對 delayAction 類型設定為 'delay' DelayAction。 設定為 'discrete' 類型 DiscreteAction '連續'
'延遲'
'discrete' (必要)

ChaosExperimentBranch

名稱 說明 價值觀
行為 動作清單。 ChaosExperimentAction[] (必要)
名稱 分支名稱的字串。 字串

約束:
最小長度 = 1 (必要)

ChaosExperimentStep

名稱 說明 價值觀
分支 分支清單。 ChaosExperimentBranch[] (必要)
名稱 步驟名稱的字串。 字串

約束:
最小長度 = 1 (必要)

ChaosTargetFilter

名稱 說明 價值觀
型別 設定為 ChaosTargetSimpleFilter 類型的 'Simple'。 'Simple' (必要)

ChaosTargetListSelector

名稱 說明 價值觀
目標 目標參考清單。 TargetReference[] (必要)
型別 混亂目標選取器歧視性類型 'List' (必要)

ChaosTargetQuerySelector

名稱 說明 價值觀
queryString 查詢字串 目標資源的 Azure Resource Graph (ARG) 查詢語言查詢。 字串 (必要)
subscriptionIds 訂閱ID 範圍資源查詢的訂用帳戶標識碼清單。 string[] (必要)
型別 混亂目標選取器歧視性類型 'Query' (必要)

ChaosTargetSelector

名稱 說明 價值觀
篩選 模型,表示可套用至目標清單的可用篩選類型。 ChaosTargetFilter
識別碼 選取器識別碼的字串。 字串

約束:
最小長度 = 1 (必要)
型別 設定為 ChaosTargetListSelector 類型的 'List'。 設定為 ChaosTargetQuerySelector 類型的 『Query』。 '清單'
'Query' (必要)

ChaosTargetSimpleFilter

名稱 說明 價值觀
參數 代表簡單篩選參數的模型。 ChaosTargetSimpleFilterParameters
型別 Chaos 目標篩選歧視性類型 'Simple' (必要)

ChaosTargetSimpleFilterParameters

名稱 說明 價值觀
區域 要篩選目標的 Azure 可用性區域清單。 字串[]

連續作

名稱 說明 價值觀
持續時間 ISO8601表示持續時間的格式化字串。 字串 (必要)
參數 索引鍵值組的清單。 KeyValuePair[] (必要)
選擇器ID 表示選取器的字串。 字串

約束:
最小長度 = 1 (必要)
型別 混亂實驗動作歧視性類型 'continuous' (必要)

DelayAction (延遲作)

名稱 說明 價值觀
持續時間 ISO8601表示持續時間的格式化字串。 字串 (必要)
型別 混亂實驗動作歧視性類型 'delay' (必要)

離散作

名稱 說明 價值觀
參數 索引鍵值組的清單。 KeyValuePair[] (必要)
選擇器ID 表示選取器的字串。 字串

約束:
最小長度 = 1 (必要)
型別 混亂實驗動作歧視性類型 'discrete' (必要)

實驗屬性

名稱 說明 價值觀
選擇器 選取器清單。 ChaosTargetSelector[] (必要)
步驟 步驟清單。 ChaosExperimentStep[] (必要)

KeyValuePair 鍵值對

名稱 說明 價值觀
Key 動作的設定名稱。 字串

約束:
最小長度 = 1 (必要)
價值 動作設定的值。 字串

約束:
最小長度 = 1 (必要)

ManagedServiceIdentity

名稱 說明 價值觀
型別 受控服務識別的類型(允許 SystemAssigned 和 UserAssigned 類型)。 “無”
“系統分配”
'SystemAssigned,UserAssigned'
'UserAssigned' (必要)
使用者指派的身份 與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中的空白物件 ({})。 UserAssignedIdentities

目標引用

名稱 說明 價值觀
識別碼 目標資源的資源識別符字串。 字串 (必要)
型別 目標參考類型的列舉。 'ChaosTarget' (必要)

TrackedResourceTags

名稱 說明 價值觀

UserAssignedIdentities

名稱 說明 價值觀

UserAssignedIdentity

名稱 說明 價值觀

使用範例

Terraform (AzAPI 提供者) 資源定義

實驗資源類型可以使用目標作業來部署:

  • 資源群組

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.Chaos/實驗資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Chaos/experiments@2025-01-01"
  name = "string"
  parent_id = "string"
  identity {
    type = "string"
    identity_ids = [
      "string"
    ]
  }
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      selectors = [
        {
          filter = {
            type = "string"
            // For remaining properties, see ChaosTargetFilter objects
          }
          id = "string"
          type = "string"
          // For remaining properties, see ChaosTargetSelector objects
        }
      ]
      steps = [
        {
          branches = [
            {
              actions = [
                {
                  name = "string"
                  type = "string"
                  // For remaining properties, see ChaosExperimentAction objects
                }
              ]
              name = "string"
            }
          ]
          name = "string"
        }
      ]
    }
  }
}

ChaosTargetFilter 物件

設定 類型 屬性,以指定物件的類型。

針對 [簡單],請使用:

{
  parameters = {
    zones = [
      "string"
    ]
  }
  type = "Simple"
}

ChaosExperimentAction 物件

設定 類型 屬性,以指定物件的類型。

針對連續 ,請使用:

{
  duration = "string"
  parameters = [
    {
      key = "string"
      value = "string"
    }
  ]
  selectorId = "string"
  type = "continuous"
}

針對 延遲,請使用:

{
  duration = "string"
  type = "delay"
}

針對 離散,請使用:

{
  parameters = [
    {
      key = "string"
      value = "string"
    }
  ]
  selectorId = "string"
  type = "discrete"
}

ChaosTargetSelector 物件

設定 類型 屬性,以指定物件的類型。

針對 [列表],請使用:

{
  targets = [
    {
      id = "string"
      type = "string"
    }
  ]
  type = "List"
}

針對 [查詢],請使用:

{
  queryString = "string"
  subscriptionIds = [
    "string"
  ]
  type = "Query"
}

屬性值

Microsoft.Chaos/實驗

名稱 說明 價值觀
身分識別 指派給此資源的受控服務識別。 ManagedServiceIdentity
位置 資源所在的地理位置 字串 (必要)
名稱 資源名稱 字串

約束:
最小長度 = 1
模式 = ^[^<>%&:?#/\\]+$ (必要)
屬性 實驗資源的屬性。 ExperimentProperties (必要)
標記 資源標籤 標記名稱和值的字典。
型別 資源類型 “Microsoft.Chaos/experiments@2025-01-01”

ChaosExperimentAction

名稱 說明 價值觀
名稱 表示功能 URN 的字串。 字串

約束:
最大長度 = 2048 (必要)
型別 將 類型設定為 'continuous',ContinuousAction。 針對 delayAction 類型設定為 'delay' DelayAction。 設定為 'discrete' 類型 DiscreteAction '連續'
'延遲'
'discrete' (必要)

ChaosExperimentBranch

名稱 說明 價值觀
行為 動作清單。 ChaosExperimentAction[] (必要)
名稱 分支名稱的字串。 字串

約束:
最小長度 = 1 (必要)

ChaosExperimentStep

名稱 說明 價值觀
分支 分支清單。 ChaosExperimentBranch[] (必要)
名稱 步驟名稱的字串。 字串

約束:
最小長度 = 1 (必要)

ChaosTargetFilter

名稱 說明 價值觀
型別 設定為 ChaosTargetSimpleFilter 類型的 'Simple'。 'Simple' (必要)

ChaosTargetListSelector

名稱 說明 價值觀
目標 目標參考清單。 TargetReference[] (必要)
型別 混亂目標選取器歧視性類型 'List' (必要)

ChaosTargetQuerySelector

名稱 說明 價值觀
queryString 查詢字串 目標資源的 Azure Resource Graph (ARG) 查詢語言查詢。 字串 (必要)
subscriptionIds 訂閱ID 範圍資源查詢的訂用帳戶標識碼清單。 string[] (必要)
型別 混亂目標選取器歧視性類型 'Query' (必要)

ChaosTargetSelector

名稱 說明 價值觀
篩選 模型,表示可套用至目標清單的可用篩選類型。 ChaosTargetFilter
識別碼 選取器識別碼的字串。 字串

約束:
最小長度 = 1 (必要)
型別 設定為 ChaosTargetListSelector 類型的 'List'。 設定為 ChaosTargetQuerySelector 類型的 『Query』。 '清單'
'Query' (必要)

ChaosTargetSimpleFilter

名稱 說明 價值觀
參數 代表簡單篩選參數的模型。 ChaosTargetSimpleFilterParameters
型別 Chaos 目標篩選歧視性類型 'Simple' (必要)

ChaosTargetSimpleFilterParameters

名稱 說明 價值觀
區域 要篩選目標的 Azure 可用性區域清單。 字串[]

連續作

名稱 說明 價值觀
持續時間 ISO8601表示持續時間的格式化字串。 字串 (必要)
參數 索引鍵值組的清單。 KeyValuePair[] (必要)
選擇器ID 表示選取器的字串。 字串

約束:
最小長度 = 1 (必要)
型別 混亂實驗動作歧視性類型 'continuous' (必要)

DelayAction (延遲作)

名稱 說明 價值觀
持續時間 ISO8601表示持續時間的格式化字串。 字串 (必要)
型別 混亂實驗動作歧視性類型 'delay' (必要)

離散作

名稱 說明 價值觀
參數 索引鍵值組的清單。 KeyValuePair[] (必要)
選擇器ID 表示選取器的字串。 字串

約束:
最小長度 = 1 (必要)
型別 混亂實驗動作歧視性類型 'discrete' (必要)

實驗屬性

名稱 說明 價值觀
選擇器 選取器清單。 ChaosTargetSelector[] (必要)
步驟 步驟清單。 ChaosExperimentStep[] (必要)

KeyValuePair 鍵值對

名稱 說明 價值觀
Key 動作的設定名稱。 字串

約束:
最小長度 = 1 (必要)
價值 動作設定的值。 字串

約束:
最小長度 = 1 (必要)

ManagedServiceIdentity

名稱 說明 價值觀
型別 受控服務識別的類型(允許 SystemAssigned 和 UserAssigned 類型)。 “無”
“系統分配”
'SystemAssigned,UserAssigned'
'UserAssigned' (必要)
使用者指派的身份 與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中的空白物件 ({})。 UserAssignedIdentities

目標引用

名稱 說明 價值觀
識別碼 目標資源的資源識別符字串。 字串 (必要)
型別 目標參考類型的列舉。 'ChaosTarget' (必要)

TrackedResourceTags

名稱 說明 價值觀

UserAssignedIdentities

名稱 說明 價值觀

UserAssignedIdentity

名稱 說明 價值觀