Update-AzActionGroup
update a new action group or update an existing one.
语法
UpdateExpanded (默认值)
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>]
UpdateViaIdentityExpanded
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>]
说明
update a new action group or update an existing one.
示例
Example 1: Add receiver to specified action group
$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": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"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 : {}
This command updates specified action group with name and group.
Example 2: Delete receiver to specified action group
$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 : {}
The first command get specified action group.
The final command updates specified action group with action group object.
参数
-ArmRoleReceiver
The list of ARM role receivers that are part of this action group.
Roles are Azure RBAC roles and only built-in roles are supported.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-AutomationRunbookReceiver
The list of AutomationRunbook receivers that are part of this action group.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-AzureAppPushReceiver
The list of AzureAppPush receivers that are part of this action group.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-AzureFunctionReceiver
The list of azure function receivers that are part of this action group.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Confirm
Prompts you for confirmation before running the cmdlet.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-DefaultProfile
The DefaultProfile parameter is not functional.
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
参数属性
类型: PSObject
默认值: None
支持通配符: False
不显示: False
别名: AzureRMContext, AzureCredential
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-EmailReceiver
The list of email receivers that are part of this action group.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Enabled
Indicates whether this action group is enabled.
If an action group is not enabled, then none of its receivers will receive communications.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-EventHubReceiver
The list of event hub receivers that are part of this action group.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-GroupShortName
The short name of the action group.
This will be used in SMS messages.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
别名: ShortName
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
Identity Parameter
UpdateViaIdentityExpanded
Position: Named
必需: True
来自管道的值: True
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ItsmReceiver
The list of ITSM receivers that are part of this action group.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-LogicAppReceiver
The list of logic app receivers that are part of this action group.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Name
The name of the action group.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
别名: ActionGroupName
参数集
UpdateExpanded
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ResourceGroupName
The name of the resource group.
The name is case insensitive.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
UpdateExpanded
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-SmsReceiver
The list of SMS receivers that are part of this action group.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-SubscriptionId
The ID of the target subscription.
参数属性
类型: String
默认值: (Get-AzContext).Subscription.Id
支持通配符: False
不显示: False
参数集
UpdateExpanded
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Tag
Resource tags
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-VoiceReceiver
The list of voice receivers that are part of this action group.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-WebhookReceiver
The list of webhook receivers that are part of this action group.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
输出