Scenarios - Create Or Update
シナリオを作成または更新する。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/workspaces/{workspaceName}/scenarios/{scenarioName}?api-version=2026-08-01-preview
URI パラメーター
| 名前 | / | 必須 | 型 | 説明 |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
リソース グループの名前。 名前は大文字と小文字を区別しません。 |
|
scenario
|
path | True |
string minLength: 1pattern: ^[^<>%&:?#/\\]+$ |
シナリオの名前です。 |
|
subscription
|
path | True |
string (uuid) |
ターゲット サブスクリプションの ID。 値は UUID である必要があります。 |
|
workspace
|
path | True |
string minLength: 1pattern: ^[^<>%&:?#/\\]+$ |
ワークスペースのリソース名を表す文字列です。 |
|
api-version
|
query | True |
string minLength: 1 |
この操作に使用する API バージョン。 |
要求本文
| 名前 | 型 | 説明 |
|---|---|---|
| properties |
シナリオの性質。 |
応答
| 名前 | 型 | 説明 |
|---|---|---|
| 200 OK |
リソース「シナリオ」更新操作が成功しました |
|
| 201 Created |
リソース「シナリオ」作成操作成功 |
|
| Other Status Codes |
予期しないエラー応答。 |
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー。
型:
oauth2
フロー:
implicit
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
スコープ
| 名前 | 説明 |
|---|---|
| user_impersonation | あなたのユーザー アカウントになりすます |
例
Create or update a scenario.
要求のサンプル
PUT https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/workspaces/exampleWorkspace/scenarios/zoneDownScenario?api-version=2026-08-01-preview
{
"properties": {
"description": "Induces an outage of all discovered VM and VMSS instances in the target zone with an option to invoke custom scripted actions using Automation Runbooks. Additionally, it forces failover of discovered Redis instances to simulate backend zonal outage.",
"parameters": [
{
"name": "duration",
"type": "string",
"default": "PT15M",
"required": false,
"description": "The duration of the outage scenario."
},
{
"name": "customRunbook1ResourceId",
"type": "string",
"required": false,
"description": "Optional custom runbook 1 resource ID. If not provided, this action will be skipped."
},
{
"name": "customRunbook1ParametersJson",
"type": "string",
"required": false,
"default": "{}",
"description": "Optional custom runbook 1 parameters in JSON format."
}
],
"actions": [
{
"name": "vmssZoneDown",
"actionId": "urn:csci:microsoft:compute:shutdown/1.0.0",
"description": "Force shutdown VMSS instances in target zone",
"duration": "%%{parameters.duration}%%",
"parameters": [
{
"key": "zones",
"value": "%%{filters.zones}%%"
}
]
},
{
"name": "vmZoneDown",
"actionId": "urn:csci:microsoft:compute:shutdown/1.0.0",
"description": "Force shutdown VM instances in target zone",
"duration": "%%{parameters.duration}%%",
"parameters": [
{
"key": "zones",
"value": "%%{filters.zones}%%"
}
]
},
{
"name": "redisFailover",
"actionId": "urn:csci:microsoft:azureClusteredCacheForRedis:Reboot/1.0.0",
"description": "Force failover of Redis instances to simulate backend zonal outage",
"duration": "PT5M",
"parameters": [
{
"key": "RebootType",
"value": "PrimaryNode"
}
]
},
{
"name": "custom-runbook-1",
"actionId": "urn:csci:microsoft:Automation:StartRunbook/1.0.0",
"description": "Custom Runbook 1",
"duration": "PT30M",
"parameters": [
{
"key": "RunbookParameters",
"value": "%%{parameters.customRunbook1ParametersJson}%%"
}
],
"externalResource": {
"resourceId": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Automation/automationAccounts/exampleAutomationAccount/runbooks/exampleRunbook"
}
}
]
}
}
応答のサンプル
{
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/workspaces/exampleWorkspace/scenarios/zoneDownScenario",
"name": "zoneDownScenario",
"type": "Microsoft.Chaos/workspaces/scenarios",
"properties": {
"provisioningState": "Succeeded",
"version": "1.0",
"description": "Induces an outage of all discovered VM and VMSS instances in the target zone with an option to invoke custom scripted actions using Automation Runbooks. Additionally, it forces failover of discovered Redis instances to simulate backend zonal outage.",
"parameters": [
{
"name": "duration",
"type": "string",
"default": "PT15M",
"required": false,
"description": "The duration of the outage scenario."
},
{
"name": "customRunbook1ResourceId",
"type": "string",
"required": false,
"description": "Optional custom runbook 1 resource ID. If not provided, this action will be skipped."
},
{
"name": "customRunbook1ParametersJson",
"type": "string",
"required": false,
"default": "{}",
"description": "Optional custom runbook 1 parameters in JSON format."
}
],
"actions": [
{
"name": "vmssZoneDown",
"actionId": "urn:csci:microsoft:compute:shutdown/1.0.0",
"description": "Force shutdown VMSS instances in target zone",
"duration": "%%{parameters.duration}%%",
"parameters": [
{
"key": "zones",
"value": "%%{filters.zones}%%"
}
]
},
{
"name": "vmZoneDown",
"actionId": "urn:csci:microsoft:compute:shutdown/1.0.0",
"description": "Force shutdown VM instances in target zone",
"duration": "%%{parameters.duration}%%",
"parameters": [
{
"key": "zones",
"value": "%%{filters.zones}%%"
}
]
},
{
"name": "redisFailover",
"actionId": "urn:csci:microsoft:azureClusteredCacheForRedis:Reboot/1.0.0",
"description": "Force failover of Redis instances to simulate backend zonal outage",
"duration": "PT5M",
"parameters": [
{
"key": "RebootType",
"value": "PrimaryNode"
}
]
},
{
"name": "custom-runbook-1",
"actionId": "urn:csci:microsoft:Automation:StartRunbook/1.0.0",
"description": "Custom Runbook 1",
"duration": "PT30M",
"parameters": [
{
"key": "RunbookParameters",
"value": "%%{parameters.customRunbook1ParametersJson}%%"
}
],
"externalResource": {
"resourceId": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Automation/automationAccounts/exampleAutomationAccount/runbooks/exampleRunbook"
}
}
]
},
"systemData": {
"createdAt": "2025-01-15T10:30:00.000Z",
"createdBy": "admin@contoso.com",
"createdByType": "User",
"lastModifiedAt": "2025-01-15T10:30:00.000Z",
"lastModifiedBy": "admin@contoso.com",
"lastModifiedByType": "User"
}
}
{
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/workspaces/exampleWorkspace/scenarios/zoneDownScenario",
"name": "zoneDownScenario",
"type": "Microsoft.Chaos/workspaces/scenarios",
"properties": {
"provisioningState": "Creating",
"version": "1.0",
"description": "Induces an outage of all discovered VM and VMSS instances in the target zone with an option to invoke custom scripted actions using Automation Runbooks. Additionally, it forces failover of discovered Redis instances to simulate backend zonal outage.",
"parameters": [
{
"name": "duration",
"type": "string",
"default": "PT15M",
"required": false,
"description": "The duration of the outage scenario."
},
{
"name": "customRunbook1ResourceId",
"type": "string",
"required": false,
"description": "Optional custom runbook 1 resource ID. If not provided, this action will be skipped."
},
{
"name": "customRunbook1ParametersJson",
"type": "string",
"required": false,
"default": "{}",
"description": "Optional custom runbook 1 parameters in JSON format."
}
],
"actions": [
{
"name": "vmssZoneDown",
"actionId": "urn:csci:microsoft:compute:shutdown/1.0.0",
"description": "Force shutdown VMSS instances in target zone",
"duration": "%%{parameters.duration}%%",
"parameters": [
{
"key": "zones",
"value": "%%{filters.zones}%%"
}
]
},
{
"name": "vmZoneDown",
"actionId": "urn:csci:microsoft:compute:shutdown/1.0.0",
"description": "Force shutdown VM instances in target zone",
"duration": "%%{parameters.duration}%%",
"parameters": [
{
"key": "zones",
"value": "%%{filters.zones}%%"
}
]
},
{
"name": "redisFailover",
"actionId": "urn:csci:microsoft:azureClusteredCacheForRedis:Reboot/1.0.0",
"description": "Force failover of Redis instances to simulate backend zonal outage",
"duration": "PT5M",
"parameters": [
{
"key": "RebootType",
"value": "PrimaryNode"
}
]
},
{
"name": "custom-runbook-1",
"actionId": "urn:csci:microsoft:Automation:StartRunbook/1.0.0",
"description": "Custom Runbook 1",
"duration": "PT30M",
"parameters": [
{
"key": "RunbookParameters",
"value": "%%{parameters.customRunbook1ParametersJson}%%"
}
],
"externalResource": {
"resourceId": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Automation/automationAccounts/exampleAutomationAccount/runbooks/exampleRunbook"
}
}
]
},
"systemData": {
"createdAt": "2025-01-15T10:30:00.000Z",
"createdBy": "admin@contoso.com",
"createdByType": "User",
"lastModifiedAt": "2025-01-15T10:30:00.000Z",
"lastModifiedBy": "admin@contoso.com",
"lastModifiedByType": "User"
}
}
定義
| 名前 | 説明 |
|---|---|
|
Action |
アクション依存性を表すモデル。 |
|
Action |
アクション依存タイプのための列挙。 |
|
Action |
アクションライフサイクル状態のための列挙式です。 |
|
created |
リソースを作成した ID の種類。 |
|
Error |
リソース管理エラーの追加情報 |
|
Error |
エラーの詳細。 |
|
Error |
エラー応答 |
|
External |
外部リソース参照を表すモデル。 |
|
Key |
アクションや構成のパラメータを記述するために使われるキーと値のペア。 |
|
Parameter |
パラメータ型のための列挙。 |
|
Provisioning |
特定のAzure Chaosリソースの現在のプロビジョニング状態。 |
| Recommendation |
シナリオ推奨を表すモデル。 |
|
Recommendation |
シナリオ検証状態の列挙。 |
|
Run |
アクション依存性を表すモデル。 |
|
Run |
複数の依存関係をどのように評価するかを定義します。 |
| Scenario |
シナリオを表すモデルです。 |
|
Scenario |
シナリオアクションを表すモデル。 |
|
Scenario |
単一のシナリオパラメータ定義を表すモデル。 |
|
Scenario |
シナリオの性質を表すモデルです。 |
|
system |
リソースの作成と最後の変更に関連するメタデータ。 |
ActionDependency
アクション依存性を表すモデル。
| 名前 | 型 | 説明 |
|---|---|---|
| name |
string |
これはアクションの名前によります。 |
| onActionLifecycle |
このアクションを開始する依存性アクションのライフサイクル状態。 |
|
| type |
依存の種類。 |
ActionDependencyType
アクション依存タイプのための列挙。
| 値 | 説明 |
|---|---|
| Action |
アクション依存タイプ。 |
ActionLifecycle
アクションライフサイクル状態のための列挙式です。
| 値 | 説明 |
|---|---|
| AnyTerminal |
アクションが任意の終端状態に達したときにトリガーされます。 |
| Start |
アクションが始まったときにトリガーします。 |
| Running |
アクションが進行中でトリガーします。 |
| Success |
成功時にトリガー。 |
| Failure |
失敗時にトリガー。 |
| Skipped |
アクションがスキップされたときにトリガーします。 |
createdByType
リソースを作成した ID の種類。
| 値 | 説明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorAdditionalInfo
リソース管理エラーの追加情報
| 名前 | 型 | 説明 |
|---|---|---|
| info |
object |
追加情報。 |
| type |
string |
追加情報の種類。 |
ErrorDetail
エラーの詳細。
| 名前 | 型 | 説明 |
|---|---|---|
| additionalInfo |
エラーに関する追加情報。 |
|
| code |
string |
エラー コード。 |
| details |
エラーの詳細。 |
|
| message |
string |
エラー メッセージ。 |
| target |
string |
エラーの対象。 |
ErrorResponse
エラー応答
| 名前 | 型 | 説明 |
|---|---|---|
| error |
エラー オブジェクト。 |
ExternalResource
外部リソース参照を表すモデル。
| 名前 | 型 | 説明 |
|---|---|---|
| resourceId |
string (arm-id) |
外部リソースのリソースID |
KeyValuePair
アクションや構成のパラメータを記述するために使われるキーと値のペア。
| 名前 | 型 | 説明 |
|---|---|---|
| key |
string minLength: 1 |
アクションの設定の名前。 |
| value |
string minLength: 1 |
アクションの設定の値。 |
ParameterType
パラメータ型のための列挙。
| 値 | 説明 |
|---|---|
| string |
文字列パラメータ型。 |
| number |
数値パラメータの種類。 |
| boolean |
ブールパラメータ型。 |
| object |
オブジェクトパラメータタイプ。 |
| array |
配列パラメータ型。 |
ProvisioningState
特定のAzure Chaosリソースの現在のプロビジョニング状態。
| 値 | 説明 |
|---|---|
| Succeeded |
リソースが作成されました。 |
| Failed |
リソースの作成に失敗しました。 |
| Canceled |
リソースの作成が取り消されました。 |
| Creating |
初期作成が進行中です。 |
| Updating |
更新が進行中です。 |
| Deleting |
削除が進行中です。 |
| Running |
アクションが始まっています。 |
Recommendation
シナリオ推奨を表すモデル。
| 名前 | 型 | 説明 |
|---|---|---|
| evaluationRunAt |
string (date-time) |
推薦が評価されたUTC時刻。 |
| recommendationStatus |
推薦の状況。 |
RecommendationStatus
シナリオ検証状態の列挙。
| 値 | 説明 |
|---|---|
| NotEvaluated |
シナリオ推奨の状況は評価されていません。 |
| Recommended |
シナリオ推奨ステータスは推奨されます。 |
| NotApplicable |
シナリオ推奨のステータスは適用されません。 |
| Evaluating |
シナリオ推奨の状況は現在評価中です。 |
| EvaluationFailed |
シナリオ推奨評価は失敗しました。 |
| EvaluationCancelled |
シナリオ推奨評価は中止されました。 |
RunAfter
アクション依存性を表すモデル。
| 名前 | 型 | 規定値 | 説明 |
|---|---|---|---|
| behavior | Any |
複数の依存関係をどのように評価するかを定義します。 |
|
| items |
アクション依存関係の配列。 |
RunAfterBehavior
複数の依存関係をどのように評価するかを定義します。
| 値 | 説明 |
|---|---|
| Any |
すべての依存関係の後も必ず継続されます(例えば、最終ブロックのようなものです)。 |
| All |
すべての依存関係が満たされていなければ継続できません。 |
| AtLeastOne |
継続するには少なくとも1つの依存関係が満たされなければなりません。 |
Scenario
シナリオを表すモデルです。
| 名前 | 型 | 説明 |
|---|---|---|
| id |
string (arm-id) |
リソースの完全修飾リソース ID。 例: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
| name |
string |
リソースの名前 |
| properties |
シナリオの性質。 |
|
| systemData |
createdBy および modifiedBy 情報を含む Azure Resource Manager メタデータ。 |
|
| type |
string |
リソースの種類。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts" |
ScenarioAction
シナリオアクションを表すモデル。
| 名前 | 型 | 説明 |
|---|---|---|
| actionId |
string |
アクションの識別子とバージョン(例:「microsoft-compute-shutdown/1.0」)。 |
| description |
string |
この動作が何をするかを人間が読みやすく説明する。 |
| duration |
string |
ISO 8601の動作時間(例:PT30Mで30分間)を表示します。 テンプレートマクロ構文(%%{parameters.<name>}%%)。 |
| externalResource |
アクションのための外部リソース参照。 |
|
| name |
string pattern: ^[a-zA-Z0-9-_]+$ |
アクションのユニークな名前です。 |
| parameters |
アクション固有のパラメータ値。 |
|
| runAfter |
アクションの開始時期を制御するアクション依存関係。 |
|
| timeout |
string |
ISO 8601の実行時間は最大実行時間です。 テンプレートマクロ構文をサポートしています。 |
| waitBefore |
string |
ISO 8601の動作開始までの待機時間(例:PT30Sの30秒間)です。 テンプレートマクロ構文をサポートしています。 |
ScenarioParameter
単一のシナリオパラメータ定義を表すモデル。
| 名前 | 型 | 説明 |
|---|---|---|
| default |
string |
パラメータのデフォルト値。 |
| description |
string |
パラメーターの説明。 |
| name |
string minLength: 1 |
パラメーターの名前。 |
| required |
boolean |
このパラメータが必要かどうか。 |
| type |
パラメータデータ型。 |
ScenarioProperties
シナリオの性質を表すモデルです。
| 名前 | 型 | 説明 |
|---|---|---|
| actions |
シナリオのオーケストレーションを定義する一連のアクション。 |
|
| createdFrom |
string |
このシナリオが作成されたテンプレートバージョンのリソースID(任意)。 |
| description |
string |
このシナリオが何をするのかの説明(任意)。 |
| parameters |
シナリオのパラメータ定義。 |
|
| provisioningState |
与えられたシナリオリソースの最新のプロビジョニング状態。 |
|
| recommendation |
このシナリオの推奨情報。 |
|
| version |
string |
シナリオのバージョンです。 |
systemData
リソースの作成と最後の変更に関連するメタデータ。
| 名前 | 型 | 説明 |
|---|---|---|
| createdAt |
string (date-time) |
リソース作成のタイムスタンプ (UTC)。 |
| createdBy |
string |
リソースを作成した ID。 |
| createdByType |
リソースを作成した ID の種類。 |
|
| lastModifiedAt |
string (date-time) |
リソースの最終変更のタイムスタンプ (UTC) |
| lastModifiedBy |
string |
リソースを最後に変更した ID。 |
| lastModifiedByType |
リソースを最後に変更した ID の種類。 |