New-AzApplicationGatewayHttpListener
Creates an HTTP listener for an application gateway.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
New-AzApplicationGatewayHttpListener
-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>]
New-AzApplicationGatewayHttpListener
-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 New-AzApplicationGatewayHttpListener cmdlet creates an HTTP listener for an Azure application gateway.
Examples
Example 1: Create an HTTP listener
PS C:\>$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
PS C:\>$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
PS C:\>$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
PS C:\> $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
Customer error of an application gateway
| Type: | PSApplicationGatewayCustomError[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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 commandlet 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.
| Type: | PSApplicationGatewayWebApplicationFirewallPolicy |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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//resourceGroups//providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/�
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies front-end IP configuration object for the HTTP listener.
| Type: | PSApplicationGatewayFrontendIPConfiguration |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the ID of the front-end IP configuration for the HTTP listener.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the front-end port for the HTTP listener.
| Type: | PSApplicationGatewayFrontendPort |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the ID of the front-end port object for the HTTP listener.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the host name of the application gateway HTTP listener.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Host names
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the HTTP listener that this cmdlet creates.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the protocol that the HTTP listener uses.
| Type: | String |
| Accepted values: | Http, Https |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
| Type: | String |
| Accepted values: | true, false |
| Position: | Named |
| Default value: | true |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the SSL certificate object for the HTTP listener.
| Type: | PSApplicationGatewaySslCertificate |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the ID of the SSL certificate for the HTTP listener.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
SslProfile
| Type: | PSApplicationGatewaySslProfile |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
SslProfileId
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
None
Outputs
PSApplicationGatewayHttpListener