$vnet = Get-AzureRMVirtualNetwork
-Name Vnet01 -ResourceGroupName psrg01
$subnetconfig = Get-AzureRMVirtualNetworkSubnetConfig -Name
'Subnet01' -VirtualNetwork $vnet
$subnet=$vnet.subnets[0]
$gipconfig =
New-AzureRmApplicationGatewayIPConfiguration -Name gatewayIP01 -Subnet $subnet
$pool =
New-AzureRmApplicationGatewayBackendAddressPool -Name pool01
-BackendIPAddresses 192.168.1.20, 192.168.2.21
$poolSetting =
New-AzureRmApplicationGatewayBackendHttpSettings -Name poolsetting01 -Port 80
-Protocol Http -CookieBasedAffinity Enabled
$fp =
New-AzureRmApplicationGatewayFrontendPort -Name frontendport01 -Port 443
$cert =
New-AzureRmApplicationGatewaySslCertificate -Name cert01 -CertificateFile
C:\SSL_cert\smarterpcom_azure.pfx -Password "xxxxxx"
$fipconfig = New-AzureRmApplicationGatewayFrontendIPConfig
-Name fipconfig01 -Subnet $subnet
$listener =
New-AzureRmApplicationGatewayHttpListener -Name listener01 -Protocol Https -FrontendIPConfiguration
$fipconfig -FrontendPort $fp -SslCertificate $cert
$rule = New-AzureRmApplicationGatewayRequestRoutingRule
-Name rule01 -RuleType Basic -BackendHttpSettings $poolSetting -HttpListener
$listener -BackendAddressPool $pool
$sku =
New-AzureRmApplicationGatewaySku -Name Standard_Small -Tier Standard -Capacity
2
$appgw = New-AzureRmApplicationGateway
-Name appgwtest -ResourceGroupName appgw-rg -Location CentralUS
-BackendAddressPools $pool -BackendHttpSettingsCollection $poolSetting
-FrontendIpConfigurations $fipconfig
-GatewayIpConfigurations $gipconfig -FrontendPorts $fp -HttpListeners
$listener -RequestRoutingRules $rule -Sku $sku -SslCertificates $cert
Lookup
========
Get-AzureRmApplicationGateway -Name
appgwtest -ResourceGroupName appgw-rg
Remove
========
Remove-AzureRmApplicationGateway -Name appgwtest
-ResourceGroupName appgw-rg