Edit

Share via


New-AzApplicationGatewayHttpListener

Creates an HTTP listener for an application gateway.

Syntax

SetByResourceId

New-AzApplicationGatewayHttpListener
    -Name <String>
    -Protocol <String>
    [-FrontendIPConfigurationId <String>]
    [-FrontendPortId <String>]
    [-SslCertificateId <String>]
    [-FirewallPolicyId <String>]
    [-SslProfileId <String>]
    [-HostName <String>]
    [-HostNames <String[]>]
    [-RequireServerNameIndication <String>]
    [-CustomErrorConfiguration <PSApplicationGatewayCustomError[]>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

SetByResource

New-AzApplicationGatewayHttpListener
    -Name <String>
    -Protocol <String>
    [-FrontendIPConfiguration <PSApplicationGatewayFrontendIPConfiguration>]
    [-FrontendPort <PSApplicationGatewayFrontendPort>]
    [-FirewallPolicy <PSApplicationGatewayWebApplicationFirewallPolicy>]
    [-SslCertificate <PSApplicationGatewaySslCertificate>]
    [-SslProfile <PSApplicationGatewaySslProfile>]
    [-HostName <String>]
    [-HostNames <String[]>]
    [-RequireServerNameIndication <String>]
    [-CustomErrorConfiguration <PSApplicationGatewayCustomError[]>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The New-AzApplicationGatewayHttpListener cmdlet creates an HTTP listener for an Azure application gateway.

Examples

Example 1: Create an HTTP listener

$Listener = New-AzApplicationGatewayHttpListener -Name "Listener01" -Protocol "Http" -FrontendIpConfiguration $FIp01 -FrontendPort $FP01

This command creates an HTTP listener named Listener01 and stores the result in the variable named $Listener.

Example 2: Create an HTTP listener with SSL

$Listener = New-AzApplicationGatewayHttpListener -Name "Listener01" -Protocol "Https" -FrontendIpConfiguration $FIp01 -FrontendPort $FP01 -SslCertificate $SSLCert01

This command creates an HTTP listener that uses SSL offload and provides the SSL certificate in the $SSLCert01 variable. The command stores the result in the variable named $Listener.

Example 3: Create an HTTP listener with firewall-policy

$Listener = New-AzApplicationGatewayHttpListener -Name "Listener01" -Protocol "Http" -FrontendIpConfiguration $FIp01 -FrontendPort $FP01 -FirewallPolicy $firewallPolicy

This command creates an HTTP listener named Listener01, FirewallPolicy as $firewallPolicy and stores the result in the variable named $Listener.

Example 4: Add a HTTPS listener with SSL and HostNames

$Listener = New-AzApplicationGatewayHttpListener -Name "Listener01" -Protocol "Https" -FrontendIpConfiguration $FIp01 -FrontendPort $FP01 -SslCertificate $SSLCert01 -HostNames "*.contoso.com","www.microsoft.com"

This command creates an HTTP listener that uses SSL offload and provides the SSL certificate in the $SSLCert01 variable along with two HostNames. The command stores the result in the variable named $Listener.

Parameters

-CustomErrorConfiguration

Customer error of an application gateway

Parameter properties

Type:

PSApplicationGatewayCustomError[]

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

-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

-FirewallPolicy

Specifies the object reference to a top-level firewall policy. The object reference can be created by using New-AzApplicationGatewayWebApplicationFirewallPolicy cmdlet. $firewallPolicy = New-AzApplicationGatewayFirewallPolicy -Name "wafPolicy1" -ResourceGroup "rgName" A firewall policy created using the above cmdlet can be referred at a path-rule level. he above command would create a default policy settings and managed rules. Instead of the default values, users can specify PolicySettings, ManagedRules by using New-AzApplicationGatewayFirewallPolicySettings and New-AzApplicationGatewayFirewallPolicyManagedRules respectively.

Parameter properties

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

Parameter sets

SetByResource
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FirewallPolicyId

Specifies the ID of an existing top-level web application firewall resource. Firewall policy IDs can be returned by using the Get-AzApplicationGatewayWebApplicationFirewallPolicy cmdlet. After we have the ID you can use FirewallPolicyId parameter instead of FirewallPolicy parameter. For instance: -FirewallPolicyId "/subscriptions/<subscription-id>/resourceGroups/<resource-group-id>/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/<firewallPolicyName>"

Parameter properties

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

Parameter sets

SetByResourceId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FrontendIPConfiguration

Specifies front-end IP configuration object for the HTTP listener.

Parameter properties

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

Parameter sets

SetByResource
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FrontendIPConfigurationId

Specifies the ID of the front-end IP configuration for the HTTP listener.

Parameter properties

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

Parameter sets

SetByResourceId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FrontendPort

Specifies the front-end port for the HTTP listener.

Parameter properties

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

Parameter sets

SetByResource
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FrontendPortId

Specifies the ID of the front-end port object for the HTTP listener.

Parameter properties

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

Parameter sets

SetByResourceId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HostName

Specifies the host name of the application gateway HTTP listener.

Parameter properties

Type:String
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

-HostNames

Host names

Parameter properties

Type:

String[]

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

-Name

Specifies the name of the HTTP listener that this cmdlet creates.

Parameter properties

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

Parameter sets

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

-Protocol

Specifies the protocol that the HTTP listener uses.

Parameter properties

Type:String
Default value:None
Accepted values:Http, Https
Supports wildcards:False
DontShow:False

Parameter sets

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

-RequireServerNameIndication

The New-AzApplicationGatewayHttpListener cmdlet creates an HTTP listener for an Azure application gateway.

Parameter properties

Type:String
Default value:true
Accepted values:true, false
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

-SslCertificate

Specifies the SSL certificate object for the HTTP listener.

Parameter properties

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

Parameter sets

SetByResource
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SslCertificateId

Specifies the ID of the SSL certificate for the HTTP listener.

Parameter properties

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

Parameter sets

SetByResourceId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SslProfile

SslProfile

Parameter properties

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

Parameter sets

SetByResource
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SslProfileId

SslProfileId

Parameter properties

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

Parameter sets

SetByResourceId
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

None

Outputs

PSApplicationGatewayHttpListener