Edit

Share via


New-AzAutomationWebhook

Creates a webhook for an Automation runbook.

Syntax

Default (Default)

New-AzAutomationWebhook
    [-Name] <String>
    [-RunbookName] <String>
    [-IsEnabled] <Boolean>
    [-ExpiryTime] <DateTimeOffset>
    [-Parameters <IDictionary>]
    [-Force]
    [-RunOn <String>]
    [-ResourceGroupName] <String>
    [-AutomationAccountName] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The New-AzAutomationWebhook cmdlet creates a webhook for an Azure Automation runbook. Be sure to save the webhook URL that this cmdlet returns, because it cannot be retrieved again.

Examples

Example 1: Create a webhook

$Webhook = New-AzAutomationWebhook -Name "Webhook06" -IsEnabled $True -ExpiryTime "10/2/2016" -RunbookName "ContosoRunbook" -ResourceGroupName "ResourceGroup01" -AutomationAccountName "AutomationAccount01" -Force

This command creates a webhook named Webhook06 for the runbook named ContosoRunbook in the Automation account named AutomationAccount01. The command stores the webhook in the $Webhook variable. The webhook is enabled. The webhook expires at the specified time. This command does not provide any values for webhook parameters. This command specifies the Force parameter. Therefore, it does not prompt you for confirmation.

Example 2: Create a webhook with parameters

$Params = @{"StringParam"="Hello World";"IntegerParam"=32}
$Webhook = New-AzAutomationWebhook -Name "Webhook11" -Parameters $Params -IsEnabled $True -ExpiryTime "10/2/2016" -RunbookName "ContosoRunbook" -ResourceGroupName "ResourceGroup01" -AutomationAccountName "AutomationAccount01" -Force

The first command creates a dictionary of parameters, and stores them in the $Params variable. The second command creates a webhook named Webhook11 for the runbook named ContosoRunbook in the Automation account named AutomationAccount01. The command assigns the parameters in $Params to the webhook.

Parameters

-AutomationAccountName

Specifies the name of an Automation account in which this cmdlet creates a webhook.

Parameter properties

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

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExpiryTime

Specifies the expiry time for the webhook as a DateTimeOffset object. You can specify a string or a DateTime that can be converted to a valid DateTimeOffset.

Parameter properties

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

Parameter sets

(All)
Position:5
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Force

ps_force

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IsEnabled

Specifies whether the webhook is enabled.

Parameter properties

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

Parameter sets

(All)
Position:4
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies a name for the webhook.

Parameter properties

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

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Parameters

Specifies a dictionary of key/value pairs. The keys are the runbook parameter names. The values are the runbook parameter values. When the runbook starts in response to a webhook, these parameters are passed to the runbook.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

Specifies the name of the resource group for which this cmdlet creates a webhook.

Parameter properties

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

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-RunbookName

Specifies the name of the runbook to associate to the webhook.

Parameter properties

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

Parameter sets

(All)
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-RunOn

Optional name of the hybrid worker group which should execute the runbook

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Inputs

String

Boolean

DateTimeOffset

Outputs

Webhook