Muokkaa

Jaa


Update-AzActionGroup

update a new action group or update an existing one.

Syntax

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

Description

update a new action group or update an existing one.

Examples

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.

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

-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