Quickstart: Direct web traffic using the portal - Azure Application Gateway (2024)

  • Article

In this quickstart, you use the Azure portal to create an Azure Application Gateway and test it to make sure it works correctly. You assign listeners to ports, create rules, and add resources to a backend pool. For the sake of simplicity, a simple setup is used with a public frontend IP address, a basic listener to host a single site on the application gateway, a basic request routing rule, and two virtual machines (VMs) in the backend pool.

Quickstart: Direct web traffic using the portal - Azure Application Gateway (1)

For more information about the components of an application gateway, see Application gateway components.

You can also complete this quickstart using Azure PowerShell or Azure CLI.

Prerequisites

An Azure account with an active subscription is required. If you don't already have an account, you can create an account for free.

Sign in to the Azure portal with your Azure account.

Create an application gateway

Create the application gateway using the tabs on the Create application gateway page.

  1. On the Azure portal menu or from the Home page, select Create a resource.
  2. Under Categories, select Networking and then select Application Gateway in the Popular Azure services list.

Basics tab

  1. On the Basics tab, enter these values for the following application gateway settings:

    • Resource group: Select myResourceGroupAG for the resource group. If it doesn't exist, select Create new to create it.

    • Application gateway name: Enter myAppGateway for the name of the application gateway.

    • Use the default selections for other settings.

      Quickstart: Direct web traffic using the portal - Azure Application Gateway (2)

  2. For Azure to communicate between the resources that you create, a virtual network is needed. You can either create a new virtual network or use an existing one. In this example, you'll create a new virtual network at the same time that you create the application gateway. Application Gateway instances are created in separate subnets. You create two subnets in this example: One for the application gateway, and another for the backend servers.

    Note

    Virtual network service endpoint policies are currently not supported in an Application Gateway subnet.

    Under Configure virtual network, create a new virtual network by selecting Create new. In the Create virtual network window that opens, enter the following values to create the virtual network and two subnets:

    • Name: Enter myVNet for the name of the virtual network.

    • Subnet name (Application Gateway subnet): The Subnets list shows a subnet named default. Change the name of this subnet to myAGSubnet.
      The application gateway subnet can contain only application gateways. No other resources are allowed. The default IP address range provided is 10.0.0.0/24.

      Quickstart: Direct web traffic using the portal - Azure Application Gateway (3)

    Select OK to close the Create virtual network window and save the virtual network settings.

  3. Select Next: Frontends.

Frontends tab

  1. On the Frontends tab, verify Frontend IP address type is set to Public.
    You can configure the Frontend IP to be Public or Private as per your use case. In this example, you'll choose a Public Frontend IP.

    Note

    For the Application Gateway v2 SKU, there must be a Public frontend IP configuration. You can still have both a Public and a Private frontend IP configuration, but Private only frontend IP configuration (Only ILB mode) is currently not enabled for the v2 SKU.

  2. Select Add new for the Public IP address and enter myAGPublicIPAddress for the public IP address name, and then select OK.

    Quickstart: Direct web traffic using the portal - Azure Application Gateway (4)

Note

Application Gateway frontend now supports dual-stack IP addresses (Public Preview). You can now create up to four frontend IP addresses: Two IPv4 addresses (public and private) and two IPv6 addresses (public and private).

  1. Select Next: Backends.

Backends tab

The backend pool is used to route requests to the backend servers that serve the request. Backend pools can be composed of NICs, Virtual Machine Scale Sets, public IP addresses, internal IP addresses, fully qualified domain names (FQDN), and multitenant backends like Azure App Service. In this example, you'll create an empty backend pool with your application gateway and then add backend targets to the backend pool.

  1. On the Backends tab, select Add a backend pool.

  2. In the Add a backend pool window that opens, enter the following values to create an empty backend pool:

    • Name: Enter myBackendPool for the name of the backend pool.
    • Add backend pool without targets: Select Yes to create a backend pool with no targets. You'll add backend targets after creating the application gateway.
  3. In the Add a backend pool window, select Add to save the backend pool configuration and return to the Backends tab.

    Quickstart: Direct web traffic using the portal - Azure Application Gateway (5)

  4. On the Backends tab, select Next: Configuration.

Configuration tab

On the Configuration tab, you'll connect the frontend and backend pool you created using a routing rule.

  1. Select Add a routing rule in the Routing rules column.

  2. In the Add a routing rule window that opens, enter the following values for Rule name and Priority:

    • Rule name: Enter myRoutingRule for the name of the rule.
    • Priority: The priority value should be between 1 and 20000 (where 1 represents highest priority and 20000 represents lowest) - for the purposes of this quickstart, enter 100 for the priority.
  3. A routing rule requires a listener. On the Listener tab within the Add a routing rule window, enter the following values for the listener:

    • Listener name: Enter myListener for the name of the listener.

    • Frontend IP: Select Public to choose the public IP you created for the frontend.

      Accept the default values for the other settings on the Listener tab, then select the Backend targets tab to configure the rest of the routing rule.

    Quickstart: Direct web traffic using the portal - Azure Application Gateway (6)

  4. On the Backend targets tab, select myBackendPool for the Backend target.

  5. For the Backend setting, select Add new to add a new Backend setting. The Backend setting determines the behavior of the routing rule. In the Add Backend setting window that opens, enter myBackendSetting for the Backend settings name and 80 for the Backend port. Accept the default values for the other settings in the Add Backend setting window, then select Add to return to the Add a routing rule window.

    Quickstart: Direct web traffic using the portal - Azure Application Gateway (7)

  6. On the Add a routing rule window, select Add to save the routing rule and return to the Configuration tab.

    Quickstart: Direct web traffic using the portal - Azure Application Gateway (8)

  7. Select Next: Tags and then Next: Review + create.

Review + create tab

Review the settings on the Review + create tab, and then select Create to create the virtual network, the public IP address, and the application gateway. It can take several minutes for Azure to create the application gateway. Wait until the deployment finishes successfully before moving on to the next section.

Quickstart: Direct web traffic using the portal - Azure Application Gateway (9)

Add backend targets

In this example, you'll use virtual machines as the target backend. You can either use existing virtual machines or create new ones. You'll create two virtual machines as backend servers for the application gateway.

To do this, you'll:

  1. Add a backend subnet.
  2. Create two new VMs, myVM and myVM2, to be used as backend servers.
  3. Install IIS on the virtual machines to verify that the application gateway was created successfully.
  4. Add the backend servers to the backend pool.

Add a backend subnet

The subnet myAGSubnet can only contain the application gateway, so we need another subnet to add backend targets.

To create a backend subnet:

  1. Select the myVNet resource. You can select it under Deployment details after deployment of the application gateway is complete, or you can search for Virtual networks and select it from the list.

  2. Under Settings, select Subnets and then select + Subnet to begin adding a new subnet.

    • Name: Enter myBackendSubnet.
    • Subnet address range: Enter an address range that doesn't overlap with the address range of myAGSubnet. For example, if the address range of myAGSubnet is 10.0.0.0/24, enter 10.0.1.0/24 for the address range of myBackendSubnet. This address range might be already entered by default.
  3. Use the default settings for other items and then select Save.

Quickstart: Direct web traffic using the portal - Azure Application Gateway (10)

Create a virtual machine

  1. On the Azure portal menu or from the Home page, select Create a resource. The New window appears.

  2. Select Windows Server 2016 Datacenter in the Popular list. The Create a virtual machine page appears.
    Application Gateway can route traffic to any type of virtual machine used in its backend pool. In this example, you use a Windows Server 2016 Datacenter virtual machine.

  3. Enter these values in the Basics tab for the following virtual machine settings:

    • Resource group: Select myResourceGroupAG for the resource group name.
    • Virtual machine name: Enter myVM for the name of the virtual machine.
    • Region: Select the same region where you created the application gateway.
    • Username: Type a name for the administrator user name.
    • Password: Type a password.
    • Public inbound ports: None.
  4. Accept the other defaults and then select Next: Disks.

  5. Accept the Disks tab defaults and then select Next: Networking.

  6. On the Networking tab, verify that myVNet is selected for the Virtual network and the Subnet is set to myBackendSubnet. Accept the other defaults and then select Next: Management.
    Application Gateway can communicate with instances outside of the virtual network that it is in, but you need to ensure there's IP connectivity.

  7. Select Next: Monitoring and set Boot diagnostics to Disable. Accept the other defaults and then select Review + create.

  8. On the Review + create tab, review the settings, correct any validation errors, and then select Create.

  9. Wait for the virtual machine creation to complete before continuing.

Install IIS for testing

In this example, you install IIS on the virtual machines to verify Azure created the application gateway successfully.

  1. Open Azure PowerShell.

    Select Cloud Shell from the top navigation bar of the Azure portal and then select PowerShell from the drop-down list.

    Quickstart: Direct web traffic using the portal - Azure Application Gateway (11)

  2. Run the following command to install IIS on the virtual machine. Change the Location parameter if necessary:

    Set-AzVMExtension ` -ResourceGroupName myResourceGroupAG ` -ExtensionName IIS ` -VMName myVM ` -Publisher Microsoft.Compute ` -ExtensionType CustomScriptExtension ` -TypeHandlerVersion 1.4 ` -SettingString '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell Add-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value $($env:computername)"}' ` -Location EastUS
  3. Create a second virtual machine and install IIS by using the steps that you previously completed. Use myVM2 for the virtual machine name and for the VMName setting of the Set-AzVMExtension cmdlet.

Add backend servers to backend pool

  1. On the Azure portal menu, select All resources or search for and select All resources. Then select myAppGateway.

  2. Select Backend pools from the left menu.

  3. Select myBackendPool.

  4. Under Backend targets, Target type, select Virtual machine from the drop-down list.

  5. Under Target, select the myVM and myVM2 virtual machines and their associated network interfaces from the drop-down lists.

    Quickstart: Direct web traffic using the portal - Azure Application Gateway (12)

  6. Select Save.

  7. Wait for the deployment to complete before proceeding to the next step.

Test the application gateway

Although IIS isn't required to create the application gateway, you installed it in this quickstart to verify if Azure successfully created the application gateway.

Use IIS to test the application gateway:

  1. Find the public IP address for the application gateway on its Overview page.Quickstart: Direct web traffic using the portal - Azure Application Gateway (13) Or, you can select All resources, enter myAGPublicIPAddress in the search box, and then select it in the search results. Azure displays the public IP address on the Overview page.

  2. Copy the public IP address, and then paste it into the address bar of your browser to browse that IP address.

  3. Check the response. A valid response verifies that the application gateway was successfully created and can successfully connect with the backend.

    Quickstart: Direct web traffic using the portal - Azure Application Gateway (14)

    Refresh the browser multiple times and you should see connections to both myVM and myVM2.

Clean up resources

When you no longer need the resources that you created with the application gateway, delete the resource group. When you delete the resource group, you also remove the application gateway and all the related resources.

To delete the resource group:

  1. On the Azure portal menu, select Resource groups or search for and select Resource groups.
  2. On the Resource groups page, search for myResourceGroupAG in the list, then select it.
  3. On the Resource group page, select Delete resource group.
  4. Enter myResourceGroupAG under TYPE THE RESOURCE GROUP NAME and then select Delete.

Next steps

Tutorial: Configure an application gateway with TLS termination using the Azure portal

Quickstart: Direct web traffic using the portal - Azure Application Gateway (2024)

FAQs

What is the difference between Application Gateway and traffic manager? ›

The Application Gateway includes configurable horizontal autoscaling so that it can react automatically to application demand changes. Azure Traffic Manager is a DNS-based global traffic load balancer that distributes traffic to services across global Azure regions while providing high availability and responsiveness.

What is the main function of the Application Gateway in Azure? ›

Azure Application Gateway is a web traffic (OSI layer 7) load balancer that enables you to manage traffic to your web applications. Traditional load balancers operate at the transport layer (OSI layer 4 - TCP and UDP) and route traffic based on source IP address and port, to a destination IP address and port.

What are the characteristics of traffic control using application gateways? ›

Application gateway supports the ability to redirect traffic on the Application Gateway. This simplifies application configuration, optimizes the resource usage, and supports new redirection scenarios, including global and path-based redirection.

Which gateway provides for the management of traffic to web applications? ›

Azure Application Gateway is a critical component in cloud services, serving as a web traffic load balancer that operates at the application layer to manage traffic to web applications efficiently and securely.

What is the difference between Azure Application Gateway and Azure traffic manager? ›

Comparing the market share of Azure Traffic Manager and Azure Application Gateway. Azure Traffic Manager has a 10.31% market share in the Load Balancer category, while Azure Application Gateway has a 9.72% market share in the same space.

Which is the main advantage of having an Application Gateway? ›

App gateways help simplify operations and improve user satisfaction. Key benefits and advantages include: Superior user experiences – with an app gateway, users seamlessly access all their applications and services, from any location or device, using a single set of logon credentials.

What is the benefit of Application Gateway in Azure? ›

  • Platform-managed, scalable, and highly available application delivery controller as a service.
  • 99.95 percent uptime service-level agreement for multi-instance deployments.
  • Customizable layer 7 load-balancing solution.
  • Integrated web application firewall.

What is the difference between Application Gateway and web application firewall in Azure? ›

Azure Firewall is for non-web incoming traffic and all outgoing traffic. App Gateway WAF is for incoming web traffic. The Web Application Firewall (WAF) is a feature of Application Gateway that provides centralized inbound protection of your web applications from common exploits and vulnerabilities.

Which services are features of Azure Application Gateway? ›

What features does Application Gateway support? Application Gateway supports autoscaling, TLS offloading, and end-to-end TLS, a web application firewall (WAF), cookie-based session affinity, URL path-based routing, multisite hosting, and other features.

How to implement Application Gateway in Azure? ›

Create an application gateway. Create the application gateway using the tabs on the Create application gateway page. On the Azure portal menu or from the Home page, select Create a resource. Under Categories, select Networking and then select Application Gateway in the Popular Azure services list.

What is the max throughput of Azure Application Gateway? ›

Current compute units — Indicates CPU utilization. 1 Application Gateway instance is approximately 10 compute units. Throughput — Application Gateway instance can serve ~500 Mbps of throughput.

What does Azure traffic manager do? ›

Azure Traffic Manager operates at the DNS layer to quickly and efficiently direct incoming DNS requests based on the routing method of your choice. An example would be sending requests to the closest endpoints, improving the responsiveness of your applications.

Which criteria does an application gateway use to route requests to a web server? ›

The users authentication information.
  • Which criteria does Application Gateway use to route requests to a web server?
  • The region in which the servers hosting the web application are located.
  • The hostname, port, and path in the URL of the request.
  • The IP address of the web server that is the target of the request.
Feb 23, 2024

How many endpoints are there in Azure traffic manager? ›

There are three types of endpoint supported by Traffic Manager: Azure endpoints are used for services hosted in Azure. External endpoints are used for IPv4/IPv6 addresses, FQDNs, or for services hosted outside Azure.

What is gateway traffic? ›

Gateways serve as an entry and exit point for a network as all data must pass through or communicate with the gateway prior to being routed. In most IP-based networks, the only traffic that does not go through at least one gateway is traffic flowing among nodes on the same local area network (LAN) segment.

What is the difference between load balancer and traffic manager and Application Gateway in Azure? ›

In a nutshell, Azure Load Balancer is an excellent choice for distributing network traffic across multiple virtual machines at the transport layer, while Azure Application Gateway excels at managing and optimizing HTTP/HTTPS traffic with advanced application-level capabilities.

What is the main difference between load balancer and traffic manager? ›

The job of Azure Load Balancer is to direct traffic inside a region. This is combined with Azure Traffic Manager, where traffic manager routes interior to a region between virtual machines. If you combine the two you get global traffic management combined with local failover.

What is the difference between load balancer Application Gateway traffic manager and front door? ›

While both Front Door and Application Gateway are layer 7 (HTTP/HTTPS) load balancers, the main difference is that Front Door is a non-regional service and can load balance between different scale units/clusters/stamp units across regions whereas Application Gateway is a regional service and allows users to load ...

What is the Application Gateway also known as? ›

An application-level gateway (ALG, also known as application layer gateway, application gateway, application proxy, or application-level proxy) is a security component that augments a firewall or NAT employed in a mobile network.

Top Articles
Latest Posts
Article information

Author: Annamae Dooley

Last Updated:

Views: 6236

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Annamae Dooley

Birthday: 2001-07-26

Address: 9687 Tambra Meadow, Bradleyhaven, TN 53219

Phone: +9316045904039

Job: Future Coordinator

Hobby: Archery, Couponing, Poi, Kite flying, Knitting, Rappelling, Baseball

Introduction: My name is Annamae Dooley, I am a witty, quaint, lovely, clever, rich, sparkling, powerful person who loves writing and wants to share my knowledge and understanding with you.