Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

New-AzActionGroup

create a new action group or create an existing one.

Syntax

CreateExpanded (Default)

New-AzActionGroup
 -Name <String>
 -ResourceGroupName <String>
 -Location <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>]

CreateViaJsonString

New-AzActionGroup
 -Name <String>
 -ResourceGroupName <String>
 -JsonString <String>
 [-SubscriptionId <String>]
 [-DefaultProfile <PSObject>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

CreateViaJsonFilePath

New-AzActionGroup
 -Name <String>
 -ResourceGroupName <String>
 -JsonFilePath <String>
 [-SubscriptionId <String>]
 [-DefaultProfile <PSObject>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

CreateViaIdentityExpanded

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.

Parameter properties

Type:

IArmRoleReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-AutomationRunbookReceiver

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

Parameter properties

Type:

IAutomationRunbookReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-AzureAppPushReceiver

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

Parameter properties

Type:

IAzureAppPushReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-AzureFunctionReceiver

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

Parameter properties

Type:

IAzureFunctionReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-DefaultProfile

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

Parameter properties

Type:PSObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureRMContext, AzureCredential

Parameter sets

-EmailReceiver

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

Parameter properties

Type:

IEmailReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Enabled

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-EventHubReceiver

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

Parameter properties

Type:

IEventHubReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-GroupShortName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ShortName

Parameter sets

-InputObject

Identity Parameter

Parameter properties

Type:IActionGroupIdentity
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ItsmReceiver

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

Parameter properties

Type:

IItsmReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-JsonFilePath

Path of Json file supplied to the Create operation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-JsonString

Json string supplied to the Create operation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Location

Resource location

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-LogicAppReceiver

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

Parameter properties

Type:

ILogicAppReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Name

The name of the action group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ActionGroupName

Parameter sets

-ResourceGroupName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-SmsReceiver

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

Parameter properties

Type:

ISmsReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-SubscriptionId

The ID of the target subscription.

Parameter properties

Type:String
Default value:(Get-AzContext).Subscription.Id
Supports wildcards:False
DontShow:False

Parameter sets

-Tag

Resource tags

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-VoiceReceiver

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

Parameter properties

Type:

IVoiceReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-WebhookReceiver

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

Parameter properties

Type:

IWebhookReceiver[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

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.

Inputs

IActionGroupIdentity

Outputs

IActionGroupResource


Feedback

Was this page helpful?