< Back

New-AzureRmApplicationGateway

Tue Jan 29, 2019 9:55 pm

NAME New-AzureRmApplicationGateway



SYNOPSIS

Creates an application gateway.





SYNTAX

New-AzureRmApplicationGateway [-AsJob] [-AuthenticationCertificates

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayAuthenticationCertificate]>] -BackendAddressPools

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendAddressPool]> -BackendHttpSettingsCollection

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendHttpSettings]> [-DefaultProfile

<IAzureContextContainer>] [-EnableHttp2] [-Force] [-FrontendIPConfigurations

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayFrontendIPConfiguration]>] -FrontendPorts

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayFrontendPort]> -GatewayIPConfigurations

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayIPConfiguration]> -HttpListeners

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayHttpListener]> -Location <String> -Name <String>

[-Probes <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayProbe]>] [-RedirectConfigurations

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayRedirectConfiguration]>] -RequestRoutingRules

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayRequestRoutingRule]> -ResourceGroupName <String>

-Sku <PSApplicationGatewaySku> [-SslCertificates

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewaySslCertificate]>] [-SslPolicy

<PSApplicationGatewaySslPolicy>] [-Tag <Hashtable>] [-UrlPathMaps

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayUrlPathMap]>] [-WebApplicationFirewallConfiguration

<PSApplicationGatewayWebApplicationFirewallConfiguration>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The New-AzureRmApplicationGateway cmdlet creates an Azure application gateway.



An application gateway requires the following:



- A resource group.



- A virtual network.



- A back-end server pool, containing the IP addresses of the back-end servers.



- Back-end server pool settings. Each pool has settings such as port, protocol and cookie-based affinity, that are applied to all servers within

the pool.



- Front-end IP addresses, which are the IP addresses opened on the application gateway. A front-end IP address can be a public IP address or an

internal IP address.



- Front-end ports, which are the public ports opened on the application gateway. Traffic that hits these ports is redirected to the back-end

servers.



- A request routing rule that binds the listener and the back-end server pool. The rule defines which back-end server pool the traffic should be

directed to when it hits a particular listener.





A listener has a front-end port, front-end IP address, protocol (HTTP or HTTPS) and Secure Sockets Layer (SSL) certificate name (if configuring

SSL offload).







PARAMETERS

-AsJob [<SwitchParameter>]

Run cmdlet in the background



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-AuthenticationCertificates

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayAuthenticationCertificate]>

Specifies authentication certificates for the application gateway.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-BackendAddressPools <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendAddressPool]>

Specifies the list of back-end address pools for the application gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-BackendHttpSettingsCollection <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendHttpSettings]>

Specifies the list of back-end HTTP settings for the application gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-EnableHttp2 [<SwitchParameter>]

Whether HTTP2 is enabled.



Required? false

Position? named

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-FrontendIPConfigurations <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayFrontendIPConfiguration]>

Specifies a list of front-end IP configurations for the application gateway.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-FrontendPorts <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayFrontendPort]>

Specifies a list of front-end ports for the application gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-GatewayIPConfigurations <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayIPConfiguration]>

Specifies a list of IP configurations for the application gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-HttpListeners <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayHttpListener]>

Specifies a list of HTTP listeners for the application gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Location <String>

Specifies the region in which to create the application gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

Specifies the name of application gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Probes <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayProbe]>

Specifies probes for the application gateway.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-RedirectConfigurations <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayRedirectConfiguration]>

The list of redirect configuration



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-RequestRoutingRules <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayRequestRoutingRule]>

Specifies a list of request routing rules for the application gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group in which to create the application gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Sku <PSApplicationGatewaySku>

Specifies the stock keeping unit (SKU) of the application gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SslCertificates <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewaySslCertificate]>

Specifies the list of Secure Sockets Layer (SSL) certificates for the application gateway.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SslPolicy <PSApplicationGatewaySslPolicy>

Specifies an SSL policy for the application gateway.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Tag <Hashtable>

Key-value pairs in the form of a hash table. For example:



@{key0="value0";key1=$null;key2="value2"}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-UrlPathMaps <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayUrlPathMap]>

Specifies URL path maps for the application gateway.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-WebApplicationFirewallConfiguration <PSApplicationGatewayWebApplicationFirewallConfiguration>

Specifies a web application firewall (WAF) configuration. You can use the Get-AzureRmApplicationGatewayWebApplicationFirewallConfiguration

cmdlet to get a WAF.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Network.Models.PSApplicationGateway







NOTES









Example 1: Create an application gateway



PS C:\\> $ResourceGroup = New-AzureRmResourceGroup -Name "ResourceGroup01" -Location "West US" -Tag @{Name = "Department"; Value = "Marketing"}

PS C:\\> $Subnet = New-AzureRmVirtualNetworkSubnetConfig -Name "Subnet01" -AddressPrefix 10.0.0.0/24

PS C:\\> $VNet = New-AzureRmvirtualNetwork -Name "VNet01" -ResourceGroupName "ResourceGroup01" -Location "West US" -AddressPrefix 10.0.0.0/16

-Subnet $Subnet

PS C:\\> $VNet = Get-AzureRmvirtualNetwork -Name "VNet01" -ResourceGroupName "ResourceGroup01"

PS C:\\> $Subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name $Subnet01 -VirtualNetwork $VNet

PS C:\\> $GatewayIPconfig = New-AzureRmApplicationGatewayIPConfiguration -Name "GatewayIp01" -Subnet $Subnet

PS C:\\> $Pool = New-AzureRmApplicationGatewayBackendAddressPool -Name "Pool01" -BackendIPAddresses 10.10.10.1, 10.10.10.2, 10.10.10.3

PS C:\\> $PoolSetting = New-AzureRmApplicationGatewayBackendHttpSettings -Name "PoolSetting01" -Port 80 -Protocol "Http" -CookieBasedAffinity

"Disabled"

PS C:\\> $FrontEndPort = New-AzureRmApplicationGatewayFrontendPort -Name "FrontEndPort01" -Port 80

# Create a public IP address

PS C:\\> $PublicIp = New-AzureRmPublicIpAddress -ResourceGroupName "ResourceGroup01" -Name "PublicIpName01" -Location "West US" -AllocationMethod

"Dynamic"

PS C:\\> $FrontEndIpConfig = New-AzureRmApplicationGatewayFrontendIPConfig -Name "FrontEndConfig01" -PublicIPAddress $PublicIp

PS C:\\> $Listener = New-AzureRmApplicationGatewayHttpListener -Name "ListenerName01" -Protocol "Http" -FrontendIpConfiguration $FrontEndIpConfig

-FrontendPort $FrontEndPort

PS C:\\> $Rule = New-AzureRmApplicationGatewayRequestRoutingRule -Name "Rule01" -RuleType basic -BackendHttpSettings $PoolSetting -HttpListener

$Listener -BackendAddressPool $Pool

PS C:\\> $Sku = New-AzureRmApplicationGatewaySku -Name "Standard_Small" -Tier Standard -Capacity 2

PS C:\\> $Gateway = New-AzureRmApplicationGateway -Name "AppGateway01" -ResourceGroupName "ResourceGroup01" -Location "West US"

-BackendAddressPools $Pool -BackendHttpSettingsCollection $PoolSetting -FrontendIpConfigurations $FrontEndIpConfig -GatewayIpConfigurations

$GatewayIpConfig -FrontendPorts $FrontEndPort -HttpListeners $Listener -RequestRoutingRules $Rule -Sku $Sku



The following example creates an application gateway by first creating a resource group and a virtual network, as well as the following:



- A back-end server pool



- Back-end server pool settings



- Front-end ports



- Front-end IP addresses



- A request routing rule





These four commands create a virtual network. The first command creates a subnet configuration. The second command creates a virtual network. The

third command verifies the subnet configuration and the fourth command verifies that the virtual network is created successfully.

The following commands create the application gateway. The first command creates an IP configuration named GatewayIp01 for the subnet created

previously. The second command creates a back-end server pool named Pool01 with a list of back-end IP addresses and stores the pool in the $Pool

variable. The third command creates the settings for the back-end server pool and stores the settings in the $PoolSetting variable. The forth

command creates a front-end port on port 80, names it FrontEndPort01, and stores the port in the $FrontEndPort variable. The fifth command creates

a public IP address by using New-AzureRmPublicIpAddress. The sixth command creates a front-end IP configuration using $PublicIp, names it

FrontEndPortConfig01, and stores it in the $FrontEndIpConfig variable. The seventh command creates a listener using the previously created

$FrontEndIpConfig $FrontEndPort. The eighth command creates a rule for the listener. The ninth command sets the SKU. The tenth command creates the

gateway using the objects set by the previous commands.









RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... iongateway

New-AzureRmApplicationGatewayBackendAddressPool

New-AzureRmApplicationGatewayBackendHttpSettings

New-AzureRmApplicationGatewayFrontendIPConfig

New-AzureRmApplicationGatewayFrontendPort

New-AzureRmApplicationGatewayHttpListener

New-AzureRmApplicationGatewayIPConfiguration

New-AzureRmApplicationGatewayRequestRoutingRule

New-AzureRmApplicationGatewaySku

New-AzureRmVirtualNetwork

New-AzureRmVirtualNetworkSubnetConfig