你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzActionGroup
创建新的操作组或创建现有操作组。
语法
New-AzActionGroup
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
-Location <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>]
New-AzActionGroup
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
-JsonString <String>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzActionGroup
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
-JsonFilePath <String>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzActionGroup
-InputObject <IActionGroupIdentity>
-Location <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>]
说明
创建新的操作组或创建现有操作组。
示例
示例 1:创建操作组
$email1 = New-AzActionGroupEmailReceiverObject -EmailAddress user@example.com -Name user1
$sms1 = New-AzActionGroupSmsReceiverObject -CountryCode '{countrycode}' -Name user2 -PhoneNumber '{phonenumber}'
New-AzActionGroup -Name 'actiongroup1' -ResourceGroupName 'Monitor-Action' -Location northcentralus -GroupShortName ag1 -EmailReceiver $email1 -SmsReceiver $sms1
ArmRoleReceiver : {}
AutomationRunbookReceiver : {}
AzureAppPushReceiver : {}
AzureFunctionReceiver : {}
EmailReceiver : {{
"name": "user1",
"emailAddress": "user@example.com",
"useCommonAlertSchema": false,
"status": "Enabled"
}}
Enabled : False
EventHubReceiver : {}
GroupShortName : ag1
Id : /subscriptions/{subid}/resourceGroups/Monitor-Action/providers/microsoft.insights/actionGroups/actiongroup1
ItsmReceiver : {}
Location : northcentralus
LogicAppReceiver : {}
Name : actiongroup1
ResourceGroupName : Monitor-Action
SmsReceiver : {{
"name": "user2",
"countryCode": "{countrycode}",
"phoneNumber": "{phonenumber}",
"status": "Enabled"
}}
Tag : {
}
Type : Microsoft.Insights/ActionGroups
VoiceReceiver : {}
WebhookReceiver : {}
前两个命令创建两个接收器。 最后一个命令创建一个操作组,包括两个接收方。
示例 2:创建另一个操作组
New-AzActionGroup -Name 'actiongroup1' -ResourceGroupName 'Monitor-Action' -Location northcentralus -GroupShortName ag1
ArmRoleReceiver : {}
AutomationRunbookReceiver : {}
AzureAppPushReceiver : {}
AzureFunctionReceiver : {}
EmailReceiver : {}
Enabled : False
EventHubReceiver : {}
GroupShortName : ag1
Id : /subscriptions/{subid}/resourceGroups/Monitor-Action/providers/microsoft.insights/actionGroups/actiongroup1
ItsmReceiver : {}
Location : northcentralus
LogicAppReceiver : {}
Name : actiongroup1
ResourceGroupName : Monitor-Action
SmsReceiver : {}
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 |
-JsonFilePath
提供给“创建”操作的 Json 文件的路径
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-JsonString
提供给“创建”操作的 Json 字符串
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Location
资源位置
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | 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 |