Muokkaa

Jaa


New-AzActionGroup

create a new action group or create an existing one.

Syntax

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>]

Description

create a new action group or create an existing one.

Examples

Example 1: Create an action group

$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           : {}

The first two commands create two receivers. The final command creates an action group including the two receivers.

Example 2: create another action group

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           : {}

This command creates an action group with no receiver.

Parameters

-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.

Type:IArmRoleReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AutomationRunbookReceiver

The list of AutomationRunbook receivers that are part of this action group.

Type:IAutomationRunbookReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureAppPushReceiver

The list of AzureAppPush receivers that are part of this action group.

Type:IAzureAppPushReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureFunctionReceiver

The list of azure function receivers that are part of this action group.

Type:IAzureFunctionReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EmailReceiver

The list of email receivers that are part of this action group.

Type:IEmailReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Enabled

Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EventHubReceiver

The list of event hub receivers that are part of this action group.

Type:IEventHubReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GroupShortName

The short name of the action group. This will be used in SMS messages.

Type:String
Aliases:ShortName
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity Parameter

Type:IActionGroupIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ItsmReceiver

The list of ITSM receivers that are part of this action group.

Type:IItsmReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JsonFilePath

Path of Json file supplied to the Create operation

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-JsonString

Json string supplied to the Create operation

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Location

Resource location

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-LogicAppReceiver

The list of logic app receivers that are part of this action group.

Type:ILogicAppReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the action group.

Type:String
Aliases:ActionGroupName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group. The name is case insensitive.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SmsReceiver

The list of SMS receivers that are part of this action group.

Type:ISmsReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Tag

Resource tags

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VoiceReceiver

The list of voice receivers that are part of this action group.

Type:IVoiceReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WebhookReceiver

The list of webhook receivers that are part of this action group.

Type:IWebhookReceiver[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

IActionGroupIdentity

Outputs

IActionGroupResource