Microsoft.Chaos experiments 2022-10-01-preview

Bicep resource definition

The experiments resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Chaos/experiments resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Chaos/experiments@2022-10-01-preview' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  identity: {
    type: 'string'
  }
  properties: {
    selectors: [
      {
        filter: {
          type: 'string'
          // For remaining properties, see Filter objects
        }
        id: 'string'
        targets: [
          {
            id: 'string'
            type: 'ChaosTarget'
          }
        ]
        type: 'string'
      }
    ]
    startOnCreation: bool
    steps: [
      {
        branches: [
          {
            actions: [
              {
                name: 'string'
                type: 'string'
                // For remaining properties, see Action objects
              }
            ]
            name: 'string'
          }
        ]
        name: 'string'
      }
    ]
  }
}

Filter objects

Set the type property to specify the type of object.

For Simple, use:

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

Action objects

Set the type property to specify the type of object.

For continuous, use:

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

For delay, use:

  type: 'delay'
  duration: 'string'

For discrete, use:

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

Property values

experiments

Name Description Value
name The resource name string (required)
location The geo-location where the resource lives string (required)
tags Resource tags. Dictionary of tag names and values. See Tags in templates
identity The identity of the experiment resource. ResourceIdentity
properties The properties of the experiment resource. ExperimentProperties (required)

ResourceIdentity

Name Description Value
type String of the resource identity type. 'None'
'SystemAssigned' (required)

ExperimentProperties

Name Description Value
selectors List of selectors. Selector[] (required)
startOnCreation A boolean value that indicates if experiment should be started on creation or not. bool
steps List of steps. Step[] (required)

Selector

Name Description Value
filter Model that represents available filter types that can be applied to a targets list. Filter
id String of the selector ID. string (required)
targets List of Target references. TargetReference[] (required)
type Enum of the selector type. 'List'
'Percent'
'Random'
'Tag' (required)

Filter

Name Description Value
type Set the object type Simple (required)

SimpleFilter

Name Description Value
type Enum that discriminates between filter types. Currently only Simple type is supported. 'Simple' (required)
parameters Model that represents the Simple filter parameters. SimpleFilterParameters

SimpleFilterParameters

Name Description Value
zones List of Azure availability zones to filter targets by. string[]

TargetReference

Name Description Value
id String of the resource ID of a Target resource. string (required)
type Enum of the Target reference type. 'ChaosTarget' (required)

Step

Name Description Value
branches List of branches. Branch[] (required)
name String of the step name. string (required)

Branch

Name Description Value
actions List of actions. Action[] (required)
name String of the branch name. string (required)

Action

Name Description Value
name String that represents a Capability URN. string (required)
type Set the object type continuous
delay
discrete (required)

ContinuousAction

Name Description Value
type Enum that discriminates between action models. 'continuous' (required)
duration ISO8601 formatted string that represents a duration. string (required)
parameters List of key value pairs. KeyValuePair[] (required)
selectorId String that represents a selector. string (required)

KeyValuePair

Name Description Value
key The name of the setting for the action. string (required)
value The value of the setting for the action. string (required)

DelayAction

Name Description Value
type Enum that discriminates between action models. 'delay' (required)
duration ISO8601 formatted string that represents a duration. string (required)

DiscreteAction

Name Description Value
type Enum that discriminates between action models. 'discrete' (required)
parameters List of key value pairs. KeyValuePair[] (required)
selectorId String that represents a selector. string (required)

ARM template resource definition

The experiments resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Chaos/experiments resource, add the following JSON to your template.

{
  "type": "Microsoft.Chaos/experiments",
  "apiVersion": "2022-10-01-preview",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "identity": {
    "type": "string"
  },
  "properties": {
    "selectors": [
      {
        "filter": {
          "type": "string"
          // For remaining properties, see Filter objects
        },
        "id": "string",
        "targets": [
          {
            "id": "string",
            "type": "ChaosTarget"
          }
        ],
        "type": "string"
      }
    ],
    "startOnCreation": "bool",
    "steps": [
      {
        "branches": [
          {
            "actions": [
              {
                "name": "string",
                "type": "string"
                // For remaining properties, see Action objects
              }
            ],
            "name": "string"
          }
        ],
        "name": "string"
      }
    ]
  }
}

Filter objects

Set the type property to specify the type of object.

For Simple, use:

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

Action objects

Set the type property to specify the type of object.

For continuous, use:

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

For delay, use:

  "type": "delay",
  "duration": "string"

For discrete, use:

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

Property values

experiments

Name Description Value
type The resource type 'Microsoft.Chaos/experiments'
apiVersion The resource api version '2022-10-01-preview'
name The resource name string (required)
location The geo-location where the resource lives string (required)
tags Resource tags. Dictionary of tag names and values. See Tags in templates
identity The identity of the experiment resource. ResourceIdentity
properties The properties of the experiment resource. ExperimentProperties (required)

ResourceIdentity

Name Description Value
type String of the resource identity type. 'None'
'SystemAssigned' (required)

ExperimentProperties

Name Description Value
selectors List of selectors. Selector[] (required)
startOnCreation A boolean value that indicates if experiment should be started on creation or not. bool
steps List of steps. Step[] (required)

Selector

Name Description Value
filter Model that represents available filter types that can be applied to a targets list. Filter
id String of the selector ID. string (required)
targets List of Target references. TargetReference[] (required)
type Enum of the selector type. 'List'
'Percent'
'Random'
'Tag' (required)

Filter

Name Description Value
type Set the object type Simple (required)

SimpleFilter

Name Description Value
type Enum that discriminates between filter types. Currently only Simple type is supported. 'Simple' (required)
parameters Model that represents the Simple filter parameters. SimpleFilterParameters

SimpleFilterParameters

Name Description Value
zones List of Azure availability zones to filter targets by. string[]

TargetReference

Name Description Value
id String of the resource ID of a Target resource. string (required)
type Enum of the Target reference type. 'ChaosTarget' (required)

Step

Name Description Value
branches List of branches. Branch[] (required)
name String of the step name. string (required)

Branch

Name Description Value
actions List of actions. Action[] (required)
name String of the branch name. string (required)

Action

Name Description Value
name String that represents a Capability URN. string (required)
type Set the object type continuous
delay
discrete (required)

ContinuousAction

Name Description Value
type Enum that discriminates between action models. 'continuous' (required)
duration ISO8601 formatted string that represents a duration. string (required)
parameters List of key value pairs. KeyValuePair[] (required)
selectorId String that represents a selector. string (required)

KeyValuePair

Name Description Value
key The name of the setting for the action. string (required)
value The value of the setting for the action. string (required)

DelayAction

Name Description Value
type Enum that discriminates between action models. 'delay' (required)
duration ISO8601 formatted string that represents a duration. string (required)

DiscreteAction

Name Description Value
type Enum that discriminates between action models. 'discrete' (required)
parameters List of key value pairs. KeyValuePair[] (required)
selectorId String that represents a selector. string (required)

Terraform (AzAPI provider) resource definition

The experiments resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Chaos/experiments resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Chaos/experiments@2022-10-01-preview"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  identity {
    type =  "SystemAssigned"
  }
  body = jsonencode({
    properties = {
      selectors = [
        {
          filter = {
            type = "string"
            // For remaining properties, see Filter objects
          }
          id = "string"
          targets = [
            {
              id = "string"
              type = "ChaosTarget"
            }
          ]
          type = "string"
        }
      ]
      startOnCreation = bool
      steps = [
        {
          branches = [
            {
              actions = [
                {
                  name = "string"
                  type = "string"
                  // For remaining properties, see Action objects
                }
              ]
              name = "string"
            }
          ]
          name = "string"
        }
      ]
    }
  })
}

Filter objects

Set the type property to specify the type of object.

For Simple, use:

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

Action objects

Set the type property to specify the type of object.

For continuous, use:

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

For delay, use:

  type = "delay"
  duration = "string"

For discrete, use:

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

Property values

experiments

Name Description Value
type The resource type "Microsoft.Chaos/experiments@2022-10-01-preview"
name The resource name string (required)
location The geo-location where the resource lives string (required)
parent_id To deploy to a resource group, use the ID of that resource group. string (required)
tags Resource tags. Dictionary of tag names and values.
identity The identity of the experiment resource. ResourceIdentity
properties The properties of the experiment resource. ExperimentProperties (required)

ResourceIdentity

Name Description Value
type String of the resource identity type. "SystemAssigned" (required)

ExperimentProperties

Name Description Value
selectors List of selectors. Selector[] (required)
startOnCreation A boolean value that indicates if experiment should be started on creation or not. bool
steps List of steps. Step[] (required)

Selector

Name Description Value
filter Model that represents available filter types that can be applied to a targets list. Filter
id String of the selector ID. string (required)
targets List of Target references. TargetReference[] (required)
type Enum of the selector type. "List"
"Percent"
"Random"
"Tag" (required)

Filter

Name Description Value
type Set the object type Simple (required)

SimpleFilter

Name Description Value
type Enum that discriminates between filter types. Currently only Simple type is supported. "Simple" (required)
parameters Model that represents the Simple filter parameters. SimpleFilterParameters

SimpleFilterParameters

Name Description Value
zones List of Azure availability zones to filter targets by. string[]

TargetReference

Name Description Value
id String of the resource ID of a Target resource. string (required)
type Enum of the Target reference type. "ChaosTarget" (required)

Step

Name Description Value
branches List of branches. Branch[] (required)
name String of the step name. string (required)

Branch

Name Description Value
actions List of actions. Action[] (required)
name String of the branch name. string (required)

Action

Name Description Value
name String that represents a Capability URN. string (required)
type Set the object type continuous
delay
discrete (required)

ContinuousAction

Name Description Value
type Enum that discriminates between action models. "continuous" (required)
duration ISO8601 formatted string that represents a duration. string (required)
parameters List of key value pairs. KeyValuePair[] (required)
selectorId String that represents a selector. string (required)

KeyValuePair

Name Description Value
key The name of the setting for the action. string (required)
value The value of the setting for the action. string (required)

DelayAction

Name Description Value
type Enum that discriminates between action models. "delay" (required)
duration ISO8601 formatted string that represents a duration. string (required)

DiscreteAction

Name Description Value
type Enum that discriminates between action models. "discrete" (required)
parameters List of key value pairs. KeyValuePair[] (required)
selectorId String that represents a selector. string (required)