Experiments - Create Or Update

Create or update a Experiment resource.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}?api-version=2024-01-01

URI Parameters

Name In Required Type Description
experimentName
path True

string

String that represents a Experiment resource name.

Regex pattern: ^[^<>%&:?#/\\]+$

resourceGroupName
path True

string

String that represents an Azure resource group.

Regex pattern: ^[a-zA-Z0-9_\-\.\(\)]*[a-zA-Z0-9_\-\(\)]$

subscriptionId
path True

string

GUID that represents an Azure subscription ID.

Regex pattern: ^[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}$

api-version
query True

string

String that sets the API version.

Regex pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}(|-preview)$

Request Body

Name Required Type Description
location True

string

The geo-location where the resource lives

properties.selectors True selector[]:

List of selectors.

properties.steps True

step[]

List of steps.

identity

resourceIdentity

The identity of the experiment resource.

tags

object

Resource tags.

Responses

Name Type Description
200 OK

experiment

Long running replace experiment operation.

201 Created

experiment

Long running create experiment operation.

Other Status Codes

ErrorResponse

Error response returned if request was unsuccessful.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation Impersonate your user account

Examples

Create/update a Experiment in a resource group.

Sample Request

PUT https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment?api-version=2024-01-01

{
  "location": "eastus2euap",
  "identity": {
    "type": "SystemAssigned"
  },
  "properties": {
    "steps": [
      {
        "name": "step1",
        "branches": [
          {
            "name": "branch1",
            "actions": [
              {
                "type": "continuous",
                "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
                "selectorId": "selector1",
                "duration": "PT10M",
                "parameters": [
                  {
                    "key": "abruptShutdown",
                    "value": "false"
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "selectors": [
      {
        "type": "List",
        "id": "selector1",
        "targets": [
          {
            "type": "ChaosTarget",
            "id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"
          }
        ]
      }
    ]
  }
}

Sample Response

Azure-AsyncOperation: https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/locations/eastus/operationStatus/00000000-0000-0000-0000-000000000000?api-version=2024-01-01
Location: https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/experiments/00000000-0000-0000-0000-000000000000?api-version=2024-01-01
{
  "id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment",
  "type": "Microsoft.Chaos/experiments",
  "name": "exampleExperiment",
  "location": "eastus2euap",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "d04ab567-2c07-43ef-a7f4-4527626b7f56",
    "tenantId": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6"
  },
  "properties": {
    "provisioningState": "Creating",
    "steps": [
      {
        "name": "step1",
        "branches": [
          {
            "name": "branch1",
            "actions": [
              {
                "type": "continuous",
                "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
                "selectorId": "selector1",
                "duration": "PT10M",
                "parameters": [
                  {
                    "key": "abruptShutdown",
                    "value": "false"
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "selectors": [
      {
        "type": "List",
        "id": "selector1",
        "targets": [
          {
            "type": "ChaosTarget",
            "id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"
          }
        ]
      }
    ]
  },
  "systemData": {
    "createdAt": "2021-07-01T00:00:00.0Z",
    "createdBy": "User",
    "createdByType": "b3a41dba-4415-4d36-9ee8-e5eaa86db976",
    "lastModifiedAt": "2021-07-01T00:00:00.0Z",
    "lastModifiedBy": "User",
    "lastModifiedByType": "b3a41dba-4415-4d36-9ee8-e5eaa86db976"
  }
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/locations/eastus/operationStatus/00000000-0000-0000-0000-000000000000?api-version=2024-01-01
Location: https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/experiments/00000000-0000-0000-0000-000000000000?api-version=2024-01-01
{
  "id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment",
  "type": "Microsoft.Chaos/experiments",
  "name": "exampleExperiment",
  "location": "eastus2euap",
  "identity": {
    "type": "SystemAssigned",
    "principalId": "d04ab567-2c07-43ef-a7f4-4527626b7f56",
    "tenantId": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6"
  },
  "properties": {
    "provisioningState": "Updating",
    "steps": [
      {
        "name": "step1",
        "branches": [
          {
            "name": "branch1",
            "actions": [
              {
                "type": "continuous",
                "name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
                "selectorId": "selector1",
                "duration": "PT10M",
                "parameters": [
                  {
                    "key": "abruptShutdown",
                    "value": "false"
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "selectors": [
      {
        "type": "List",
        "id": "selector1",
        "targets": [
          {
            "type": "ChaosTarget",
            "id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"
          }
        ]
      }
    ]
  },
  "systemData": {
    "createdAt": "2021-07-01T00:00:00.0Z",
    "createdBy": "User",
    "createdByType": "b3a41dba-4415-4d36-9ee8-e5eaa86db976",
    "lastModifiedAt": "2021-07-01T00:00:00.0Z",
    "lastModifiedBy": "User",
    "lastModifiedByType": "b3a41dba-4415-4d36-9ee8-e5eaa86db976"
  }
}

Definitions

Name Description
branch

Model that represents a branch in the step. 9 total per experiment.

continuousAction

Model that represents a continuous action.

createdByType

The type of identity that created the resource.

delayAction

Model that represents a delay action.

discreteAction

Model that represents a discrete action.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

experiment

Model that represents a Experiment resource.

keyValuePair

A map to describe the settings of an action.

listSelector

Model that represents a list selector.

ProvisioningState

Most recent provisioning state for the given experiment resource.

querySelector

Model that represents a query selector.

resourceIdentity

The identity of a resource.

ResourceIdentityType

String of the resource identity type.

simpleFilter

Model that represents a simple target filter.

simpleFilterParameters

Model that represents the Simple filter parameters.

step

Model that represents a step in the Experiment resource.

systemData

Metadata pertaining to creation and last modification of the resource.

targetReference

Model that represents a reference to a Target in the selector.

TargetReferenceType

Enum of the Target reference type.

UserAssignedIdentity

User assigned identity properties

branch

Model that represents a branch in the step. 9 total per experiment.

Name Type Description
actions action[]:

List of actions.

name

string

String of the branch name.

continuousAction

Model that represents a continuous action.

Name Type Description
duration

string

ISO8601 formatted string that represents a duration.

name

string

String that represents a Capability URN.

parameters

keyValuePair[]

List of key value pairs.

selectorId

string

String that represents a selector.

type string:

continuous

Enum that discriminates between action models.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

delayAction

Model that represents a delay action.

Name Type Description
duration

string

ISO8601 formatted string that represents a duration.

name

string

String that represents a Capability URN.

type string:

delay

Enum that discriminates between action models.

discreteAction

Model that represents a discrete action.

Name Type Description
name

string

String that represents a Capability URN.

parameters

keyValuePair[]

List of key value pairs.

selectorId

string

String that represents a selector.

type string:

discrete

Enum that discriminates between action models.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

experiment

Model that represents a Experiment resource.

Name Type Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

identity

resourceIdentity

The identity of the experiment resource.

location

string

The geo-location where the resource lives

name

string

The name of the resource

properties.provisioningState

ProvisioningState

Most recent provisioning state for the given experiment resource.

properties.selectors selector[]:

List of selectors.

properties.steps

step[]

List of steps.

systemData

systemData

The system metadata of the experiment resource.

tags

object

Resource tags.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

keyValuePair

A map to describe the settings of an action.

Name Type Description
key

string

The name of the setting for the action.

value

string

The value of the setting for the action.

listSelector

Model that represents a list selector.

Name Type Description
filter filter:

simpleFilter

Model that represents available filter types that can be applied to a targets list.

id

string

String of the selector ID.

targets

targetReference[]

List of Target references.

type string:

List

Enum of the selector type.

ProvisioningState

Most recent provisioning state for the given experiment resource.

Name Type Description
Canceled

string

Creating

string

Deleting

string

Failed

string

Succeeded

string

Updating

string

querySelector

Model that represents a query selector.

Name Type Description
filter filter:

simpleFilter

Model that represents available filter types that can be applied to a targets list.

id

string

String of the selector ID.

queryString

string

Azure Resource Graph (ARG) Query Language query for target resources.

subscriptionIds

string[]

Subscription id list to scope resource query.

type string:

Query

Enum of the selector type.

resourceIdentity

The identity of a resource.

Name Type Description
principalId

string

GUID that represents the principal ID of this resource identity.

tenantId

string

GUID that represents the tenant ID of this resource identity.

type

ResourceIdentityType

String of the resource identity type.

userAssignedIdentities

<string,  UserAssignedIdentity>

User-Assigned Identities
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}'.

ResourceIdentityType

String of the resource identity type.

Name Type Description
None

string

SystemAssigned

string

UserAssigned

string

simpleFilter

Model that represents a simple target filter.

Name Type Description
parameters

simpleFilterParameters

Model that represents the Simple filter parameters.

type string:

Simple

Enum that discriminates between filter types. Currently only Simple type is supported.

simpleFilterParameters

Model that represents the Simple filter parameters.

Name Type Description
zones

string[]

List of Azure availability zones to filter targets by.

step

Model that represents a step in the Experiment resource.

Name Type Description
branches

branch[]

List of branches.

name

string

String of the step name.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

targetReference

Model that represents a reference to a Target in the selector.

Name Type Description
id

string

String of the resource ID of a Target resource.

type

TargetReferenceType

Enum of the Target reference type.

TargetReferenceType

Enum of the Target reference type.

Name Type Description
ChaosTarget

string

UserAssignedIdentity

User assigned identity properties

Name Type Description
clientId

string

The client ID of the assigned identity.

principalId

string

The principal ID of the assigned identity.