Application Gateway: what it needs before you create one
In this task you'll find what an Application Gateway needs before you create one.
An Application Gateway sits in front of web servers and reads each request. A listener waits for requests on a port and address, a routing rule decides where they go (for example by path), and backend settings say how to talk to the servers, such as port, HTTPS and cookies.
It must have its own subnet that holds nothing else, and it costs money every hour from the moment it exists. So this task walks the Create form and stops before creating anything.
Example. Larkfield Group's booking site uses one Application Gateway: / goes to the website servers, /api/* goes to the API servers, and the WAF V2 tier blocks common attacks before they reach either.
Before you start
You need: Any user (to look). Time: 15 minutes (looking only).
Where to look
- Application gateways
- + Create
Steps
- Search for application gateways and select + Create.
- On Basics, open the Tier list: Basic, Standard V2 and WAF V2. Then look at Enable autoscaling (Yes by default) with Minimum instance count 0 and Maximum instance count 10.Basic is a smaller, cheaper gateway for light traffic with no autoscaling or WAF. Each instance and capacity unit adds to the bill on the V2 tiers.
- Look at Configure virtual network. Notice the gateway needs a subnet of its own.Microsoft suggests a /24 subnet, so it has room to scale.
- Without filling anything in, read the remaining tab names: Frontends (public, private or both), Backends (the server pools) and Configuration (routing rules, each with a listener and backend settings).The Configuration tab is where most of the thinking happens.
- Close the form. Don't select Review + create.
Commands
# See any Application Gateways and their tier (nothing is created)
az network application-gateway list \
--query "[].{name:name, tier:sku.tier, state:operationalState}" --output table
Watch out for
- Cost
- Looking is free. A running Standard V2 or WAF V2 gateway costs a fixed amount every hour plus capacity units, which adds up to well over £100 a month even when idle. Basic costs less but still charges every hour. Only create one with a plan to delete it within the hour.
- Security
- Choose the WAF V2 tier for anything facing the internet. Keep the gateway's subnet for the gateway only, and let it end HTTPS with a certificate from Key Vault.
- Common mistakes
- Putting other resources in the gateway's subnet, which makes the create fail. Leaving a test gateway running for days.
Clean up
Nothing to clean up, as long as you closed the Create form without creating anything.
Words to know
- Listener
- Waits for requests on a frontend address, port and (optionally) host name.
- Routing rule
- Joins a listener to a backend pool, with optional rules by path.
- Backend settings
- How the gateway talks to the servers: port, protocol, timeout and cookie affinity.
- Autoscaling
- Adding or removing gateway capacity by itself as traffic changes.
Tick off each step and track your progress in the guide.
Open this task in Azure Portal, Hands On