你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Update-AzChaosExperiment
更新试验资源。
语法
Update-AzChaosExperiment
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-EnableSystemAssignedIdentity <Boolean>]
[-Location <String>]
[-Selector <ISelector[]>]
[-Step <IStep[]>]
[-Tag <Hashtable>]
[-UserAssignedIdentity <String[]>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzChaosExperiment
-InputObject <IChaosIdentity>
[-EnableSystemAssignedIdentity <Boolean>]
[-Location <String>]
[-Selector <ISelector[]>]
[-Step <IStep[]>]
[-Tag <Hashtable>]
[-UserAssignedIdentity <String[]>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
更新试验资源。
示例
示例 1:更新试验资源标记。
Update-AzChaosExperiment -Name experiment-test -ResourceGroupName azps_test_group_chaos -Location eastus -Tag @{"a"="1"}
Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/EXPERIMENT-TEST
IdentityPrincipalId : 00001111-aaaa-2222-bbbb-3333cccc4444
IdentityTenantId : 00001111-aaaa-2222-bbbb-3333cccc4444
IdentityType : SystemAssigned
IdentityUserAssignedIdentity : {
}
Location : eastus
Name : EXPERIMENT-TEST
ProvisioningState : Succeeded
ResourceGroupName : azps_test_group_chaos
Selector : {{
"type": "List",
"id": "selector1",
"targets": [
{
"type": "ChaosTarget",
"id": "/subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microso
ft.Chaos/targets/Microsoft-VirtualMachine"
}
]
}}
Step : {{
"name": "step1",
"branches": [
{
"name": "branch1",
"actions": [
{
"type": "continuous",
"name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
"duration": "PT10M",
"parameters": [
{
"key": "abruptShutdown",
"value": "false"
}
],
"selectorId": "selector1"
}
]
}
]
}}
SystemDataCreatedAt : 2024-04-10 10:28:10 AM
SystemDataCreatedBy :
SystemDataCreatedByType : User
SystemDataLastModifiedAt : 2024-04-10 10:50:21 AM
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Tag : {
}
Type : Microsoft.Chaos/experiments
更新试验资源标记。
示例 1:更新试验资源 IdentityType。
Update-AzChaosExperiment -Name experiment-test -ResourceGroupName azps_test_group_chaos -Location eastus -UserAssignedIdentity "/subscriptions/{subId}/resourcegroups/azps_test_group_chaos/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami" -EnableSystemAssignedIdentity:$false
Id : /subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Chaos/experiments/EXPERIMENT-TEST
IdentityPrincipalId :
IdentityTenantId :
IdentityType : UserAssigned
IdentityUserAssignedIdentity : {
"/subscriptions/{subId}/resourcegroups/azps_test_group_chaos/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uami": {
}
}
Location : eastus
Name : EXPERIMENT-TEST
ProvisioningState : Succeeded
ResourceGroupName : azps_test_group_chaos
Selector : {{
"type": "List",
"id": "selector1",
"targets": [
{
"type": "ChaosTarget",
"id": "/subscriptions/{subId}/resourceGroups/azps_test_group_chaos/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microso
ft.Chaos/targets/microsoft-virtualmachine"
}
]
}}
Step : {{
"name": "step1",
"branches": [
{
"name": "branch1",
"actions": [
{
"type": "continuous",
"name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
"duration": "PT5M",
"parameters": [
{
"key": "abruptShutdown",
"value": "false"
}
],
"selectorId": "selector1"
}
]
}
]
}}
SystemDataCreatedAt : 2024-04-17 03:14:43 AM
SystemDataCreatedBy :
SystemDataCreatedByType : User
SystemDataLastModifiedAt : 2024-04-17 03:20:23 AM
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Tag : {
}
Type : Microsoft.Chaos/experiments
更新试验资源 IdentityType。
参数
-AsJob
以作业身份运行命令
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
DefaultProfile 参数不起作用。 如果对其他订阅执行 cmdlet,请使用 SubscriptionId 参数。
类型: | PSObject |
别名: | AzureRMContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EnableSystemAssignedIdentity
确定是否为资源启用系统分配的标识。
类型: | Nullable<T>[Boolean] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
标识参数
类型: | IChaosIdentity |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Location
资源所在的地理位置
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
表示试验资源名称的字符串。
类型: | String |
别名: | ExperimentName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-NoWait
异步运行命令
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
表示 Azure 资源组的字符串。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Selector
选择器列表。
类型: | ISelector[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Step
步骤列表。
类型: | IStep[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SubscriptionId
表示 Azure 订阅 ID 的 GUID。
类型: | String |
Position: | Named |
默认值: | (Get-AzContext).Subscription.Id |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Tag
资源标记。
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-UserAssignedIdentity
与资源关联的用户分配标识的数组。 数组中的元素将为 ARM 资源 ID,格式为:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 命令脚本未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |