Azure application Gateway (4) Set up URL routing-PowerShell

Source: Internet
Author: User

Windows Azure Platform Family of articles Catalog

  This article describes the Azure application Gateway URL that is created if you use Azure PowerShell Routing

Before using the reader, please check the author's previous article:Azure application Gateway (3) Set up URL routing , familiar with relevant content

Note: Azure application gateway must be created in arm mode.

In addition to PowerShell mode, it is not the same as the portal creation.

PowerShell mode, and you do not need to create a 81 port before creating a 80 port. PowerShell can directly use port 80 to set the URL Routing

#Login in the pop-up windowLogin-azurermaccount-environmentname Azurechinacloud#Select subscription informationSelect-azurermsubscription-subscriptionname"Training"#Create resource group manually, set resource group here$resourcegroupname=' LEIAPPGWRG '#Create virtual Network manually#As with previous documents, this virtual network must have 2 subnet$virtualnetworkname=' Leiappgatewayvnet '#Set Application gateway name$appgatewayname=' Leiappgateway '#Set Application Gateway public IP address$publicipname=' Leiappgatewaypublicip '#the data center where application Gateway resides$location=' China East '#set the port number$port=80$vnet=get-azurermvirtualnetwork-name$virtualnetworkname-resourcegroupname$resourcegroupname#Application Gateway joins the 2nd subnet.$subnet=$vnet. Subnets[1]$publicip= New-azurermpublicipaddress-resourcegroupname$resourcegroupname-name$publicipname-location$location-Allocationmethod Dynamic#Create Application Gateway$gipconfig= New-azurermapplicationgatewayipconfiguration-name Leiappgatewaypublicip-subnet$subnet#Set backend Pool 1$pool 1= New-azurermapplicationgatewaybackendaddresspool-name imagesbackendpool-backendipaddresses 10.0.0.4,10.0.0.5#Set backend Pool 2$pool 2= New-azurermapplicationgatewaybackendaddresspool-name videosbackendpool-backendipaddresses 10.0.0.11,10.0.0.12#Set backend Pool 1 for session hold, do not hold session$poolSetting= New-azurermapplicationgatewaybackendhttpsettings-name"imagessetting"-port$port-protocol http-cookiebasedaffinity Disabled-requesttimeout 120#Set Backend Pool 2 for session hold, to keep the session$poolSetting= New-azurermapplicationgatewaybackendhttpsettings-name"videossetting"-port$port-protocol http-cookiebasedaffinity enabled-requesttimeout 240$fipconfig= New-azurermapplicationgatewayfrontendipconfig-name"Frontend1"-publicipaddress$publicip$fp= New-azurermapplicationgatewayfrontendport-name"FEP01"-port$port$listener= New-azurermapplicationgatewayhttplistener-name"Listener01"-protocol http-frontendipconfiguration$fipconfig-frontendport$fp#set the URL Route for/images/*$imagePathRule= New-azurermapplicationgatewaypathruleconfig-name"Pathrule1"-paths"/images/*"-backendaddresspool$pool 1-backendhttpsettings$poolSetting#set the URL Route for/videos/*$videoPathRule= New-azurermapplicationgatewaypathruleconfig-name"Pathrule2"-paths"/videos/*"-backendaddresspool$pool 2-backendhttpsettings$poolSetting#Set Defaultbackendaddresspool$urlPathMap= New-azurermapplicationgatewayurlpathmapconfig-name"Urlpathmap"-pathrules$videoPathRule,$imagePathRule-defaultbackendaddresspool$pool 1-defaultbackendhttpsettings$poolSetting$rule= New-azurermapplicationgatewayrequestroutingrule-name"Rule1"-ruletype Pathbasedrouting-httplistener$listener-urlpathmap$urlPathMap#Set Application Gateway size to small with a number of 1 instances$sku= New-azurermapplicationgatewaysku-name"Standard_small"-tier standard-capacity 1#Start creating application Gateway$APPGW= New-azurermapplicationgateway-name$appgatewayname-resourcegroupname$resourcegroupname-location$location-backendaddresspools$pool 1,$pool 2-backendhttpsettingscollection$poolSetting,$poolSetting-frontendipconfigurations$fipconfig-gatewayipconfigurations$gipconfig-frontendports$fp-httplisteners$listener-urlpathmaps$urlPathMap-requestroutingrules$rule-sku$sku

Azure application Gateway (4) Set up URL routing-PowerShell

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.