Microsoft.Chaos experiments 2023-10-27-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@2023-10-27-preview' = {
  identity: {
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {}
    }
  }
  location: 'string'
  name: 'string'
  properties: {
    customerDataStorage: {
      blobContainerName: 'string'
      storageAccountResourceId: 'string'
    }
    selectors: [
      {
        filter: {
          type: 'string'
          // For remaining properties, see Filter objects
        }
        id: 'string'
        type: 'string'
        // For remaining properties, see Selector objects
      }
    ]
    steps: [
      {
        branches: [
          {
            actions: [
              {
                name: 'string'
                type: 'string'
                // For remaining properties, see Action objects
              }
            ]
            name: 'string'
          }
        ]
        name: 'string'
      }
    ]
  }
  tags: {
    {customized property}: 'string'
  }
}

Filter objects

Set the type property to specify the type of object.

For Simple, use:

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

Action objects

Set the type property to specify the type of object.

For continuous, use:

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

For delay, use:

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

For discrete, use:

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

Selector objects

Set the type property to specify the type of object.

For List, use:

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

For Query, use:

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

Property Values

Action

Name Description Value
name String that represents a Capability URN. string

Constraints:
Max length = 2048 (required)
type Set to 'continuous' for type ContinuousAction. Set to 'delay' for type DelayAction. Set to 'discrete' for type DiscreteAction. 'continuous'
'delay'
'discrete' (required)

Branch

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

Constraints:
Min length = 1 (required)

ContinuousAction

Name Description Value
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

Constraints:
Min length = 1 (required)
type Enum that discriminates between action models. 'continuous' (required)

CustomerDataStorageProperties

Name Description Value
blobContainerName Name of the Azure Blob Storage container to use or create. string

Constraints:
Min length = 3
Max length = 63
Pattern = ^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$
storageAccountResourceId ARM Resource ID of the Storage account to use for Customer Data storage. string

DelayAction

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

DiscreteAction

Name Description Value
parameters List of key value pairs. KeyValuePair[] (required)
selectorId String that represents a selector. string

Constraints:
Min length = 1 (required)
type Enum that discriminates between action models. 'discrete' (required)

ExperimentProperties

Name Description Value
customerDataStorage Optional customer-managed Storage account where Experiment schema will be stored. CustomerDataStorageProperties
selectors List of selectors. Selector[] (required)
steps List of steps. Step[] (required)

Filter

Name Description Value
type Set to 'Simple' for type SimpleFilter. 'Simple' (required)

KeyValuePair

Name Description Value
key The name of the setting for the action. string

Constraints:
Min length = 1 (required)
value The value of the setting for the action. string

Constraints:
Min length = 1 (required)

ListSelector

Name Description Value
targets List of Target references. TargetReference[] (required)
type Enum of the selector type. 'List' (required)

Microsoft.Chaos/experiments

Name Description Value
identity The identity of the experiment resource. ResourceIdentity
location The geo-location where the resource lives string (required)
name The resource name string

Constraints:
Min length = 1
Pattern = ^[^<>%&:?#/\\]+$ (required)
properties The properties of the experiment resource. ExperimentProperties (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates

QuerySelector

Name Description Value
queryString Azure Resource Graph (ARG) Query Language query for target resources. string (required)
subscriptionIds Subscription id list to scope resource query. string[] (required)
type Enum of the selector type. 'Query' (required)

ResourceIdentity

Name Description Value
type String of the resource identity type. 'None'
'SystemAssigned'
'UserAssigned' (required)
userAssignedIdentities The list of user identities associated with the Experiment. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. UserAssignedIdentities

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

Constraints:
Min length = 1 (required)
type Set to 'List' for type ListSelector. Set to 'Query' for type QuerySelector. 'List'
'Query' (required)

SimpleFilter

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

SimpleFilterParameters

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

Step

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

Constraints:
Min length = 1 (required)

TargetReference

Name Description Value
id String of the resource ID of a Target resource. string

Constraints:
Pattern = ^\/[Ss][Uu][Bb][Ss][Cc][Rr][Ii][Pp][Tt][Ii][Oo][Nn][Ss]\/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\/[Rr][Ee][Ss][Oo][Uu][Rr][Cc][Ee][Gg][Rr][Oo][Uu][Pp][Ss]\/[a-zA-Z0-9_\-\.\(\)]*[a-zA-Z0-9_\-\(\)]\/[Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr][Ss]\/[a-zA-Z0-9]+\.[a-zA-Z0-9]+\/[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+\/[Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr][Ss]\/[Mm][Ii][Cc][Rr][Oo][Ss][Oo][Ff][Tt]\.[Cc][Hh][Aa][Oo][Ss]\/[Tt][Aa][Rr][Gg][Ee][Tt][Ss]\/[a-zA-Z0-9_\-\.]+$ (required)
type Enum of the Target reference type. 'ChaosTarget' (required)

TrackedResourceTags

Name Description Value

UserAssignedIdentities

Name Description Value

UserAssignedIdentity

Name Description Value

Usage Examples

Azure Verified Modules

The following Azure Verified Modules can be used to deploy this resource type.

Module Description
Chaos Experiment AVM Resource Module for Chaos Experiment

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": "2023-10-27-preview",
  "name": "string",
  "identity": {
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {
      }
    }
  },
  "location": "string",
  "properties": {
    "customerDataStorage": {
      "blobContainerName": "string",
      "storageAccountResourceId": "string"
    },
    "selectors": [ {
      "filter": {
        "type": "string"
        // For remaining properties, see Filter objects
      },
      "id": "string",
      "type": "string"
      // For remaining properties, see Selector objects
    } ],
    "steps": [
      {
        "branches": [
          {
            "actions": [ {
              "name": "string",
              "type": "string"
              // For remaining properties, see Action objects
            } ],
            "name": "string"
          }
        ],
        "name": "string"
      }
    ]
  },
  "tags": {
    "{customized property}": "string"
  }
}

Filter objects

Set the type property to specify the type of object.

For Simple, use:

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

Action objects

Set the type property to specify the type of object.

For continuous, use:

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

For delay, use:

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

For discrete, use:

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

Selector objects

Set the type property to specify the type of object.

For List, use:

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

For Query, use:

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

Property Values

Action

Name Description Value
name String that represents a Capability URN. string

Constraints:
Max length = 2048 (required)
type Set to 'continuous' for type ContinuousAction. Set to 'delay' for type DelayAction. Set to 'discrete' for type DiscreteAction. 'continuous'
'delay'
'discrete' (required)

Branch

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

Constraints:
Min length = 1 (required)

ContinuousAction

Name Description Value
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

Constraints:
Min length = 1 (required)
type Enum that discriminates between action models. 'continuous' (required)

CustomerDataStorageProperties

Name Description Value
blobContainerName Name of the Azure Blob Storage container to use or create. string

Constraints:
Min length = 3
Max length = 63
Pattern = ^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$
storageAccountResourceId ARM Resource ID of the Storage account to use for Customer Data storage. string

DelayAction

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

DiscreteAction

Name Description Value
parameters List of key value pairs. KeyValuePair[] (required)
selectorId String that represents a selector. string

Constraints:
Min length = 1 (required)
type Enum that discriminates between action models. 'discrete' (required)

ExperimentProperties

Name Description Value
customerDataStorage Optional customer-managed Storage account where Experiment schema will be stored. CustomerDataStorageProperties
selectors List of selectors. Selector[] (required)
steps List of steps. Step[] (required)

Filter

Name Description Value
type Set to 'Simple' for type SimpleFilter. 'Simple' (required)

KeyValuePair

Name Description Value
key The name of the setting for the action. string

Constraints:
Min length = 1 (required)
value The value of the setting for the action. string

Constraints:
Min length = 1 (required)

ListSelector

Name Description Value
targets List of Target references. TargetReference[] (required)
type Enum of the selector type. 'List' (required)

Microsoft.Chaos/experiments

Name Description Value
apiVersion The api version '2023-10-27-preview'
identity The identity of the experiment resource. ResourceIdentity
location The geo-location where the resource lives string (required)
name The resource name string

Constraints:
Min length = 1
Pattern = ^[^<>%&:?#/\\]+$ (required)
properties The properties of the experiment resource. ExperimentProperties (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.Chaos/experiments'

QuerySelector

Name Description Value
queryString Azure Resource Graph (ARG) Query Language query for target resources. string (required)
subscriptionIds Subscription id list to scope resource query. string[] (required)
type Enum of the selector type. 'Query' (required)

ResourceIdentity

Name Description Value
type String of the resource identity type. 'None'
'SystemAssigned'
'UserAssigned' (required)
userAssignedIdentities The list of user identities associated with the Experiment. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. UserAssignedIdentities

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

Constraints:
Min length = 1 (required)
type Set to 'List' for type ListSelector. Set to 'Query' for type QuerySelector. 'List'
'Query' (required)

SimpleFilter

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

SimpleFilterParameters

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

Step

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

Constraints:
Min length = 1 (required)

TargetReference

Name Description Value
id String of the resource ID of a Target resource. string

Constraints:
Pattern = ^\/[Ss][Uu][Bb][Ss][Cc][Rr][Ii][Pp][Tt][Ii][Oo][Nn][Ss]\/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\/[Rr][Ee][Ss][Oo][Uu][Rr][Cc][Ee][Gg][Rr][Oo][Uu][Pp][Ss]\/[a-zA-Z0-9_\-\.\(\)]*[a-zA-Z0-9_\-\(\)]\/[Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr][Ss]\/[a-zA-Z0-9]+\.[a-zA-Z0-9]+\/[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+\/[Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr][Ss]\/[Mm][Ii][Cc][Rr][Oo][Ss][Oo][Ff][Tt]\.[Cc][Hh][Aa][Oo][Ss]\/[Tt][Aa][Rr][Gg][Ee][Tt][Ss]\/[a-zA-Z0-9_\-\.]+$ (required)
type Enum of the Target reference type. 'ChaosTarget' (required)

TrackedResourceTags

Name Description Value

UserAssignedIdentities

Name Description Value

UserAssignedIdentity

Name Description Value

Usage Examples

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@2023-10-27-preview"
  name = "string"
  identity = {
    type = "string"
    userAssignedIdentities = {
      {customized property} = {
      }
    }
  }
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      customerDataStorage = {
        blobContainerName = "string"
        storageAccountResourceId = "string"
      }
      selectors = [
        {
          filter = {
            type = "string"
            // For remaining properties, see Filter objects
          }
          id = "string"
          type = "string"
          // For remaining properties, see Selector objects
        }
      ]
      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:

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

Action objects

Set the type property to specify the type of object.

For continuous, use:

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

For delay, use:

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

For discrete, use:

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

Selector objects

Set the type property to specify the type of object.

For List, use:

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

For Query, use:

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

Property Values

Action

Name Description Value
name String that represents a Capability URN. string

Constraints:
Max length = 2048 (required)
type Set to 'continuous' for type ContinuousAction. Set to 'delay' for type DelayAction. Set to 'discrete' for type DiscreteAction. 'continuous'
'delay'
'discrete' (required)

Branch

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

Constraints:
Min length = 1 (required)

ContinuousAction

Name Description Value
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

Constraints:
Min length = 1 (required)
type Enum that discriminates between action models. 'continuous' (required)

CustomerDataStorageProperties

Name Description Value
blobContainerName Name of the Azure Blob Storage container to use or create. string

Constraints:
Min length = 3
Max length = 63
Pattern = ^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$
storageAccountResourceId ARM Resource ID of the Storage account to use for Customer Data storage. string

DelayAction

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

DiscreteAction

Name Description Value
parameters List of key value pairs. KeyValuePair[] (required)
selectorId String that represents a selector. string

Constraints:
Min length = 1 (required)
type Enum that discriminates between action models. 'discrete' (required)

ExperimentProperties

Name Description Value
customerDataStorage Optional customer-managed Storage account where Experiment schema will be stored. CustomerDataStorageProperties
selectors List of selectors. Selector[] (required)
steps List of steps. Step[] (required)

Filter

Name Description Value
type Set to 'Simple' for type SimpleFilter. 'Simple' (required)

KeyValuePair

Name Description Value
key The name of the setting for the action. string

Constraints:
Min length = 1 (required)
value The value of the setting for the action. string

Constraints:
Min length = 1 (required)

ListSelector

Name Description Value
targets List of Target references. TargetReference[] (required)
type Enum of the selector type. 'List' (required)

Microsoft.Chaos/experiments

Name Description Value
identity The identity of the experiment resource. ResourceIdentity
location The geo-location where the resource lives string (required)
name The resource name string

Constraints:
Min length = 1
Pattern = ^[^<>%&:?#/\\]+$ (required)
properties The properties of the experiment resource. ExperimentProperties (required)
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.Chaos/experiments@2023-10-27-preview"

QuerySelector

Name Description Value
queryString Azure Resource Graph (ARG) Query Language query for target resources. string (required)
subscriptionIds Subscription id list to scope resource query. string[] (required)
type Enum of the selector type. 'Query' (required)

ResourceIdentity

Name Description Value
type String of the resource identity type. 'None'
'SystemAssigned'
'UserAssigned' (required)
userAssignedIdentities The list of user identities associated with the Experiment. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. UserAssignedIdentities

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

Constraints:
Min length = 1 (required)
type Set to 'List' for type ListSelector. Set to 'Query' for type QuerySelector. 'List'
'Query' (required)

SimpleFilter

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

SimpleFilterParameters

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

Step

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

Constraints:
Min length = 1 (required)

TargetReference

Name Description Value
id String of the resource ID of a Target resource. string

Constraints:
Pattern = ^\/[Ss][Uu][Bb][Ss][Cc][Rr][Ii][Pp][Tt][Ii][Oo][Nn][Ss]\/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\/[Rr][Ee][Ss][Oo][Uu][Rr][Cc][Ee][Gg][Rr][Oo][Uu][Pp][Ss]\/[a-zA-Z0-9_\-\.\(\)]*[a-zA-Z0-9_\-\(\)]\/[Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr][Ss]\/[a-zA-Z0-9]+\.[a-zA-Z0-9]+\/[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+\/[Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr][Ss]\/[Mm][Ii][Cc][Rr][Oo][Ss][Oo][Ff][Tt]\.[Cc][Hh][Aa][Oo][Ss]\/[Tt][Aa][Rr][Gg][Ee][Tt][Ss]\/[a-zA-Z0-9_\-\.]+$ (required)
type Enum of the Target reference type. 'ChaosTarget' (required)

TrackedResourceTags

Name Description Value

UserAssignedIdentities

Name Description Value

UserAssignedIdentity

Name Description Value