你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Add-AzApplicationGatewayHttpListener

Adds an HTTP listener to an application gateway.

Syntax

Add-AzApplicationGatewayHttpListener
   -ApplicationGateway <PSApplicationGateway>
   -Name <String>
   [-FrontendIPConfigurationId <String>]
   [-FrontendPortId <String>]
   [-SslCertificateId <String>]
   [-FirewallPolicyId <String>]
   [-SslProfileId <String>]
   [-HostName <String>]
   [-HostNames <String[]>]
   [-RequireServerNameIndication <String>]
   -Protocol <String>
   [-CustomErrorConfiguration <PSApplicationGatewayCustomError[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Add-AzApplicationGatewayHttpListener
   -ApplicationGateway <PSApplicationGateway>
   -Name <String>
   [-FrontendIPConfiguration <PSApplicationGatewayFrontendIPConfiguration>]
   [-FrontendPort <PSApplicationGatewayFrontendPort>]
   [-FirewallPolicy <PSApplicationGatewayWebApplicationFirewallPolicy>]
   [-SslCertificate <PSApplicationGatewaySslCertificate>]
   [-SslProfile <PSApplicationGatewaySslProfile>]
   [-HostName <String>]
   [-HostNames <String[]>]
   [-RequireServerNameIndication <String>]
   -Protocol <String>
   [-CustomErrorConfiguration <PSApplicationGatewayCustomError[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Add-AzApplicationGatewayHttpListener cmdlet adds a HTTP listener to an application gateway.

Examples

Example 1: Add a HTTP listener

$AppGw = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
$Appgw = Add-AzApplicationGatewayHttpListener -ApplicationGateway $AppGw -Name "listener01" -Protocol "Http" -FrontendIpConfiguration $FIP01 -FrontendPort $FP01

The first command gets the application gateway and stores it in the $AppGw variable.The second command adds the HTTP listener to the application gateway.

Example 2: Add a HTTPS listener with SSL

$AppGw = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
$AppGw = Add-AzApplicationGatewayHttpListener -ApplicationGateway $AppGw -Name "Listener01" -Protocol "Https" -FrontendIpConfiguration $FIP01 -FrontendPort $FP01 -SslCertificate $SSLCert01

The first command gets the application gateway and stores it in the $AppGw variable. The second command adds the listener, which uses the HTTPS protocol, to the application gateway.

Example 3: Add a HTTPS listener with SSL and HostNames

$AppGw = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
$AppGw = Add-AzApplicationGatewayHttpListener -ApplicationGateway $AppGw -Name "Listener01" -Protocol "Https" -FrontendIpConfiguration $FIP01 -FrontendPort $FP01 -SslCertificate $SSLCert01 -HostNames "*.contoso.com","www.microsoft.com"

The first command gets the application gateway and stores it in the $AppGw variable. The second command adds the listener, which uses the HTTPS protocol, with SSL Certificates and HostNames, to the application gateway.

Parameters

-ApplicationGateway

Specifies the application gateway to which this cmdlet adds an HTTP listener.

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

-CustomErrorConfiguration

Customer error of an application gateway

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

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FirewallPolicy

FirewallPolicy

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

-FirewallPolicyId

FirewallPolicyId

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

-FrontendIPConfiguration

Specifies the application gateway front-end IP resource object.

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

-FrontendIPConfigurationId

Specifies the application gateway front-end IP ID.

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

-FrontendPort

Specifies the application gateway front-end port object.

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

-FrontendPortId

Specifies the application gateway front-end port ID.

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

-HostName

Specifies the host name that this cmdlet adds a HTTP listener to.

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

-HostNames

Host names

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

-Name

Specifies the name of the front-end port that this command adds.

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

-Protocol

Specifies the protocol of the HTTP listener. Both HTTP and HTTPS are supported.

Type:String
Accepted values:Http, Https
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RequireServerNameIndication

Type:String
Accepted values:true, false
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SslCertificate

Specifies the SSL certificate of the HTTP listener. Must be specified if HTTPS is chosen as listener protocol.

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

-SslCertificateId

Specifies the SSL certificate ID of the HTTP listener. Must be specified if HTTPS is chosen as listener protocol.

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

-SslProfile

SslProfile

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

-SslProfileId

SslProfileId

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

Inputs

PSApplicationGateway

Outputs

PSApplicationGateway