Home › Studies › AZ-700 › Network Security › Web Application Firewall

Web Application Firewall

Application Gateway vs Front Door WAF · detection and prevention · rule order and anomaly scoring · managed rule sets · policies and association · custom rules, rate limits, geo-filtering

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

Where WAF runs

Azure Web Application Firewall protects web applications from common exploits such as SQL injection and cross-site scripting. It deploys with Application Gateway, Application Gateway for Containers, Front Door and (in preview) Azure Content Delivery Network. It is in the network security category with Azure DDoS Protection and Azure Firewall.

ItemApplication Gateway WAFFront Door WAF
ScopeRegional. Portal policy type: Regional WAF (Application Gateway).Global, at Azure network edge locations. Portal policy type: Global WAF (Front Door).
Tier or SKUWAF policy associations need WAF_v2 (WAF_v1 also exists).Standard: custom rules only. Premium: full capabilities (managed rules, bot protection). Classic: older rule sets.
Managed rules based onOWASP Core Rule Set (CRS 3.2, 3.1, 3.0) and Default Rule Set (DRS 2.2, 2.1).Default Rule Set (DRS); DRS 2.0 and later use anomaly scoring.
Bot protectionBot Manager rule set (WAF v2).Bot Manager rule set; 1.1 on Premium.
Rule action typesALLOW, BLOCK, LOG, plus anomaly score for the CRS.Allow, Block, Log, Redirect, plus anomaly score (DRS 2.0 or later).
Policy attaches toApplication gateway (global), listener (per site) or path-based rule (per URI).Front Door profile, domain or route.
Log nameApplicationGatewayFirewallLogFrontDoorWebApplicationFirewallLog (Standard/Premium)

Detection and prevention mode

DetectionPrevention
BehaviorMonitors and logs the request and the matched rule. No other action.Takes the specified action when a rule matches, and logs it.
Default for a new policyYes (portal)No: change it after tuning
ProtectionNone. Useful while you tune.Blocks requests the rules detect.
Anomaly score of 5 or more (DRS 2.0+)Logged, not blockedAction set for the anomaly score (default Block)

Rule order, actions and anomaly scoring

  1. Application Gateway and Front Door process custom rules before managed rule sets. (On Front Door, the HTTP DDoS ruleset is evaluated before custom rules and an Allow custom rule does not bypass it.)
  2. Rules run in priority order; a smaller number runs first and priorities are unique.
  3. When a rule matches, its action applies and lower-priority rules aren't processed. On Front Door custom rules, only Log lets evaluation continue.
  4. Managed rules with the anomaly score action add to a total. At 5 or more the WAF acts on the request.
Rule severityAnomaly score value
Critical5
Error4
Warning3
Notice2

Managed rule sets and exclusions

TopicRule
Default stateManaged rules are on by default in Detection mode. You can disable rules and set actions per rule. You can also remove the DRS from a policy.
Front Door DRSStandard has custom rules only; managed rules need Premium (or Classic). DRS 2.0 and later use anomaly scoring. DRS 2.2 is based on OWASP CRS 3.3.4 and runs at paranoia level 1 by default.
Application GatewayCRS 3.2, 3.1, 3.0 and DRS 2.2, 2.1. CRS 3.2 needs WAF_v2 and runs on the new WAF engine, so you can't downgrade to CRS 3.1 or earlier. Microsoft’s pages differ on the recommended version: most say to use the latest DRS (2.2), one Application Gateway bullet names 2.1, and the Front Door create page names DRS 2.1 as current for Premium.
Paranoia levelPL2 rules detect more but are expected to cause false positives. In DRS 2.2 they're disabled by default. PL3 and PL4 aren't supported in Azure WAF (CRS 3.2 PL3 and PL4 rules are always inactive).
Changing versionThe portal resets rule state, actions and rule exclusions to the new version's defaults. Custom rules and policy settings aren't affected. Use PowerShell, CLI, REST or a template to keep overrides. Define WAF config as code.
Bot protectionCategories Bad, Good, Unknown. Front Door defaults: bad blocked, good allowed, unknown logged. On Application Gateway use it with any one OWASP rule set. Only one OWASP rule set at a time.
Microsoft Threat Intelligence rulesIn DRS they replace some built-in rules, which become disabled.

Exclusion lists

Policies and association

Front DoorApplication Gateway (WAF_v2)
ScopesProfile, domain, routeGateway (global), listener (per site), path-based rule (per URI)
Most specific winsRoute over domain over profilePer-URI over per-site over global
Other listeners/domainsApply shared baseline controls at profile scope, then add domain- or route-level policies only where different controls are requiredThe gateway policy still applies to listeners without their own policy
Replace or removeA domain already associated shows grayed out; remove it from the old association firstAssigning a policy to a gateway or listener that has one overwrites it. You can't disassociate a policy entirely.

Custom rules, rate limiting, geo-filtering and request limits

Front DoorApplication Gateway
Rule typesMatch rules and rate limit rulesMatchRule (rate limit rules need the new engine, CRS 3.2)
PriorityUnique integerUnique, 1 to 100; up to 100 custom rules
ActionsAllow, Block, Log, RedirectAllow, Block, Log
ConditionsSeveral per ruleConditions in one rule are ANDed; use separate rules for OR
GeoGeoMatch operator; include ZZ (unmapped IPs); max ten country/region codes per ruleGeomatch operator

CLI and PowerShell

TaskAzure CLIPowerShell
Show Application Gateway WAF policy settings-$plcy = Get-AzApplicationGatewayFirewallPolicy -Name <policy-name> -ResourceGroupName <resourcegroup-name>; $plcy.PolicySettings
Set request body inspection and size limits on an Application Gateway WAF policyaz network application-gateway waf-policy update --name <WAF Policy name> --resource-group <WAF policy RG> --set policySettings.request_body_inspect_limit_in_kb='128' policySettings.max_request_body_size_in_kb='128' policySettings.file_upload_limit_in_mb='100' --query policySettings -o table$plcy.PolicySettings.RequestBodyEnforcement=false; Set-AzApplicationGatewayFirewallPolicy -InputObject $plcy
Put an Application Gateway WAF in force mode (associate any policy)-$appgw = Get-AzApplicationGateway -Name <your Application Gateway name> -ResourceGroupName <your Resource Group name>; $appgw.ForceFirewallPolicyAssociation = $true

Exam Tips

Tick each tip once you can answer it without looking.

“A new WAF policy was created. What mode is it in, and what do you do next?” → Detection (logs only). Tune with logs and exclusions, then switch to Prevention.. Trap: Detection mode provides no protection; leaving it forever means no request is blocked.

“A WAF blocks a legitimate request that carries an authentication token in a header” → Add an exclusion for that attribute, as narrow as possible (per rule); the rest of the request is still inspected.. Trap: Disabling the whole rule set or the policy removes protection for everything else.

“Different WAF settings for each website behind one application gateway” → Per-site policies: associate a WAF policy with each listener (needs WAF_v2).. Trap: A gateway-level policy applies to all listeners that don't have their own policy.

“Two policies apply to one request: which wins?” → The most specific: Front Door route over domain over profile; Application Gateway per-URI over per-site over global.. Trap: The broader baseline policy does not override the narrower one.

“Front Door Standard profile needs managed rule sets and bot protection on its WAF” → Premium. Standard supports only custom rules.. Trap: Managed rules are supported only in Premium and Classic policies (Classic with older rule sets).

“Which rules run first, custom or managed?” → Custom rules, in ascending priority number; the first match with an action other than Log ends evaluation.. Trap: On Front Door the HTTP DDoS ruleset runs before custom rules and an Allow custom rule does not bypass it.

“Anomaly scoring: one Critical match versus one Warning match” → Critical = 5 reaches the threshold and blocks in prevention mode; Warning = 3 doesn't (Error 4, Notice 2).. Trap: In detection mode a score of 5 or more is only logged, not blocked.

“Policy state Disabled versus Detection mode on Front Door” → Disabled pauses inspection and requests bypass the WAF. Detection still evaluates and logs.. Trap: Detection mode doesn't block anything, but it still logs the matched rule.

“You change the managed rule set version in the portal and keep your tuning” → The portal resets rule state, actions and rule exclusions to defaults. Use PowerShell, CLI, REST or a template to keep them, or define config as code.. Trap: Custom rules and policy settings are not reset.

“Rate limit on Front Door” → Custom rate limit rule: threshold per 1 or 5 minutes, per socket IP by default, counted separately at each edge location.. Trap: Counts aren't aggregated globally; grouping by country, ASN or JA4 is preview and Premium only.

“Allow only customers from certain countries on Front Door” → Custom rule with GeoMatch; add the unknown code ZZ to avoid blocking unmapped IPs; at most ten codes per rule.. Trap: Forgetting ZZ can block valid users whose IPs aren't in the dataset.

“Application Gateway WAF needs rate limiting, per-rule exclusions and a 2 MB body limit” → CRS 3.2 or later (the new WAF engine); you can't downgrade from CRS 3.2 to 3.1.. Trap: CRS 3.1 and earlier run on the older engine without these features.

“What do clients see when the Front Door WAF blocks them by default?” → HTTP 403 with "The request is blocked."; a custom code (200, 403, 405, 406, 429) and message can be set at policy level.. Trap: A Redirect action needs a redirect URI defined in the policy settings.

“Remove the WAF policy from an application gateway” → Not supported. Once a policy is associated there must always be one; you can overwrite it.. Trap: Assigning a different policy to a listener overwrites its previous policy.

“Front Door WAF events aren't showing in Log Analytics” → Logs aren't enabled by default; enable diagnostic settings (FrontDoorWebApplicationFirewallLog).. Trap: Activity logs are on by default, but they record configuration changes, not WAF matches.

“Bot protection categories and Front Door defaults” → Bad, Good, Unknown. Bad blocked, good allowed, unknown logged.. Trap: Bot Manager 1.1 is available on Front Door Premium, not Standard.

“Application Gateway custom rule logic: block IP X or user agent Y” → Two separate rules. Conditions inside one rule are ANDed.. Trap: Priority must be unique, 1 to 100, and custom rules run before managed rules.

Sources

Checked against Microsoft Learn on November 13, 2026.

← Azure Firewall & Firewall ManagerNetwork Security overview →