你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Update-AzActionGroup
更新新操作组或更新现有操作组。
语法
Update-AzActionGroup
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-ArmRoleReceiver <IArmRoleReceiver[]>]
[-AutomationRunbookReceiver <IAutomationRunbookReceiver[]>]
[-AzureAppPushReceiver <IAzureAppPushReceiver[]>]
[-AzureFunctionReceiver <IAzureFunctionReceiver[]>]
[-EmailReceiver <IEmailReceiver[]>]
[-Enabled]
[-EventHubReceiver <IEventHubReceiver[]>]
[-GroupShortName <String>]
[-ItsmReceiver <IItsmReceiver[]>]
[-LogicAppReceiver <ILogicAppReceiver[]>]
[-SmsReceiver <ISmsReceiver[]>]
[-Tag <Hashtable>]
[-VoiceReceiver <IVoiceReceiver[]>]
[-WebhookReceiver <IWebhookReceiver[]>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzActionGroup
-InputObject <IActionGroupIdentity>
[-ArmRoleReceiver <IArmRoleReceiver[]>]
[-AutomationRunbookReceiver <IAutomationRunbookReceiver[]>]
[-AzureAppPushReceiver <IAzureAppPushReceiver[]>]
[-AzureFunctionReceiver <IAzureFunctionReceiver[]>]
[-EmailReceiver <IEmailReceiver[]>]
[-Enabled]
[-EventHubReceiver <IEventHubReceiver[]>]
[-GroupShortName <String>]
[-ItsmReceiver <IItsmReceiver[]>]
[-LogicAppReceiver <ILogicAppReceiver[]>]
[-SmsReceiver <ISmsReceiver[]>]
[-Tag <Hashtable>]
[-VoiceReceiver <IVoiceReceiver[]>]
[-WebhookReceiver <IWebhookReceiver[]>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
更新新操作组或更新现有操作组。
示例
示例 1:将接收方添加到指定的操作组
$enventhub = New-AzActionGroupEventHubReceiverObject -EventHubName "testEventHub" -EventHubNameSpace "actiongrouptest" -Name "sample eventhub" -SubscriptionId '{subid}'
Update-AzActionGroup -Name actiongroup1 -ResourceGroupName monitor-action -EventHubReceiver $enventhub
ArmRoleReceiver : {}
AutomationRunbookReceiver : {}
AzureAppPushReceiver : {}
AzureFunctionReceiver : {}
EmailReceiver : {{
"name": "user1",
"emailAddress": "{user}@microsoft.com",
"useCommonAlertSchema": false,
"status": "Enabled"
}}
Enabled : False
EventHubReceiver : {{
"name": "sample eventhub",
"eventHubNameSpace": "actiongrouptest",
"eventHubName": "testEventHub",
"useCommonAlertSchema": false,
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"subscriptionId": "{subid}"
}}
GroupShortName : ag1
Id : /subscriptions/{subid}/resourceGroups/monitor-action/providers/microsoft.insights/actionGroups/actiongroup1
ItsmReceiver : {}
Location : southcentralus
LogicAppReceiver : {}
Name : actiongroup1
ResourceGroupName : monitor-action
SmsReceiver : {{
"name": "user2",
"countryCode": "{code}",
"phoneNumber": "{phonenumber}",
"status": "Enabled"
}}
Tag : {
}
Type : Microsoft.Insights/ActionGroups
VoiceReceiver : {}
WebhookReceiver : {}
此命令使用名称和组更新指定的操作组。
示例 2:将接收方删除到指定的操作组
$ag = Get-AzActionGroup -Name actiongroup1 -ResourceGroupName monitor-action
Update-AzActionGroup -InputObject $ag -EventHubReceiver $null
ArmRoleReceiver : {}
AutomationRunbookReceiver : {}
AzureAppPushReceiver : {}
AzureFunctionReceiver : {}
EmailReceiver : {{
"name": "user1",
"emailAddress": "{user}@microsoft.com",
"useCommonAlertSchema": false,
"status": "Enabled"
}}
Enabled : False
EventHubReceiver : {}
GroupShortName : ag1
Id : /subscriptions/{subid}/resourceGroups/Monitor-Action/providers/microsoft.insights/actionGroups/actiongroup1
ItsmReceiver : {}
Location : southcentralus
LogicAppReceiver : {}
Name : actiongroup1
ResourceGroupName : Monitor-Action
SmsReceiver : {{
"name": "user2",
"countryCode": "{code}",
"phoneNumber": "{phonenumber}",
"status": "Enabled"
}}
Tag : {
}
Type : Microsoft.Insights/ActionGroups
VoiceReceiver : {}
WebhookReceiver : {}
第一个命令获取指定的操作组。 最后一个命令使用操作组对象更新指定的操作组。
参数
-ArmRoleReceiver
属于此操作组的 ARM 角色接收器列表。 角色是 Azure RBAC 角色,仅支持内置角色。
类型: | IArmRoleReceiver[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AutomationRunbookReceiver
属于此操作组的 AutomationRunbook 接收器的列表。
类型: | IAutomationRunbookReceiver[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AzureAppPushReceiver
属于此操作组的 AzureAppPush 接收器列表。
类型: | IAzureAppPushReceiver[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AzureFunctionReceiver
属于此操作组的 Azure 函数接收器的列表。
类型: | IAzureFunctionReceiver[] |
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 |
-EmailReceiver
属于此操作组的电子邮件接收方列表。
类型: | IEmailReceiver[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Enabled
指示是否启用此操作组。 如果未启用操作组,则其接收方不会接收通信。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EventHubReceiver
属于此操作组的事件中心接收器的列表。
类型: | IEventHubReceiver[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-GroupShortName
操作组的短名称。 这将在短信中使用。
类型: | String |
别名: | ShortName |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
标识参数
类型: | IActionGroupIdentity |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ItsmReceiver
属于此操作组的 ITSM 接收器的列表。
类型: | IItsmReceiver[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-LogicAppReceiver
属于此操作组的逻辑应用接收器列表。
类型: | ILogicAppReceiver[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
操作组的名称。
类型: | String |
别名: | ActionGroupName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
资源组的名称。 此名称不区分大小写。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SmsReceiver
属于此操作组的 SMS 接收器列表。
类型: | ISmsReceiver[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SubscriptionId
目标订阅的 ID。
类型: | String |
Position: | Named |
默认值: | (Get-AzContext).Subscription.Id |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Tag
资源标记
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-VoiceReceiver
属于此操作组的语音接收器列表。
类型: | IVoiceReceiver[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WebhookReceiver
属于此操作组的 Webhook 接收器列表。
类型: | IWebhookReceiver[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |