<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Peakhour.IO - Application Gateway</title><link href="https://www.peakhour.io/" rel="alternate"></link><link href="https://www.peakhour.io/feeds/tag/application-gateway.atom.xml" rel="self"></link><id>https://www.peakhour.io/</id><updated>2026-07-29T09:30:00+10:00</updated><entry><title>How to Tune Azure Application Gateway WAF</title><link href="https://www.peakhour.io/blog/how-to-tune-azure-application-gateway-waf/" rel="alternate"></link><published>2026-07-29T09:30:00+10:00</published><updated>2026-07-29T09:30:00+10:00</updated><author><name>AC</name></author><id>tag:www.peakhour.io,2026-07-29:/blog/how-to-tune-azure-application-gateway-waf/</id><summary type="html">&lt;p&gt;Start Azure Application Gateway WAF in Detection mode, find false positives in Log Analytics, narrow each exclusion and move into Prevention mode.&lt;/p&gt;</summary><content type="html">&lt;p&gt;An Azure WAF false positive usually arrives as a 403 and a complaint.&lt;/p&gt;
&lt;p&gt;Treat the 403 as the start of the investigation. The firewall log identifies the rule, the relevant part of the request and the policy that applied.&lt;/p&gt;
&lt;h2&gt;Put new policies into Detection mode&lt;/h2&gt;
&lt;p&gt;Use Detection mode while introducing a WAF policy, upgrading its managed ruleset or placing an existing application behind Application Gateway. The WAF records rule matches while every request continues to the application.&lt;/p&gt;
&lt;p&gt;Microsoft suggests reviewing one to two weeks of traffic before returning the policy to Prevention mode. Plan and supervise that period because attacks also continue to the application. &lt;a href="https://learn.microsoft.com/en-us/troubleshoot/azure/application-gateway/troubleshoot-waf-blocking-legitimate-requests-403"&gt;Microsoft documents this rollout in its Application Gateway WAF troubleshooting guide&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Before changing the mode, save the complete &lt;code&gt;policySettings&lt;/code&gt; block:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;az&lt;span class="w"&gt; &lt;/span&gt;network&lt;span class="w"&gt; &lt;/span&gt;application-gateway&lt;span class="w"&gt; &lt;/span&gt;waf-policy&lt;span class="w"&gt; &lt;/span&gt;show&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--name&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nv"&gt;$WAF_POLICY_NAME&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--resource-group&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nv"&gt;$RESOURCE_GROUP&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--query&lt;span class="w"&gt; &lt;/span&gt;policySettings&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--output&lt;span class="w"&gt; &lt;/span&gt;json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The Azure CLI command &lt;code&gt;az network application-gateway waf-policy policy-setting update&lt;/code&gt; rewrites the policy settings. Microsoft warns that omitting &lt;code&gt;--request-body-check&lt;/code&gt; silently resets the setting to &lt;code&gt;false&lt;/code&gt;. Supply the current value when switching modes, then read the policy back and verify it. &lt;a href="https://learn.microsoft.com/en-us/troubleshoot/azure/application-gateway/troubleshoot-waf-blocking-legitimate-requests-403#resolution-c-temporarily-switch-to-detection-mode"&gt;The warning and corrected commands appear in Microsoft’s current troubleshooting procedure&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For a policy that already inspects request bodies:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;az&lt;span class="w"&gt; &lt;/span&gt;network&lt;span class="w"&gt; &lt;/span&gt;application-gateway&lt;span class="w"&gt; &lt;/span&gt;waf-policy&lt;span class="w"&gt; &lt;/span&gt;policy-setting&lt;span class="w"&gt; &lt;/span&gt;update&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--policy-name&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nv"&gt;$WAF_POLICY_NAME&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--resource-group&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nv"&gt;$RESOURCE_GROUP&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--state&lt;span class="w"&gt; &lt;/span&gt;Enabled&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--mode&lt;span class="w"&gt; &lt;/span&gt;Detection&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--request-body-check&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Use the value returned by the first command.&lt;/p&gt;
&lt;h2&gt;Send the firewall log to Log Analytics&lt;/h2&gt;
&lt;p&gt;Application Gateway produces access and firewall logs through Azure Monitor. Microsoft recommends the resource-specific Log Analytics tables for new diagnostic settings. WAF events then appear in &lt;code&gt;AGWFirewallLogs&lt;/code&gt;; the older Azure Diagnostics mode writes them to &lt;code&gt;AzureDiagnostics&lt;/code&gt;. &lt;a href="https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-diagnostics"&gt;Microsoft explains both collection modes and recommends the resource-specific tables&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Check which table receives your data before borrowing a query from another subscription.&lt;/p&gt;
&lt;p&gt;For a resource-specific table, start here:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;AGWFirewallLogs&lt;/span&gt;
&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;TimeGenerated&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ago&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Action&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Detected&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Matched&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;summarize&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Events&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Requests&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dcount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TransactionId&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Paths&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;make_set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;RequestUri&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;by&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RuleId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PolicyScope&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PolicyScopeName&lt;/span&gt;
&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;order&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;by&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Events&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;desc&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For a workspace using the older shared table:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;AzureDiagnostics&lt;/span&gt;
&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ResourceType&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;APPLICATIONGATEWAYS&amp;quot;&lt;/span&gt;
&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Category&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;ApplicationGatewayFirewallLog&amp;quot;&lt;/span&gt;
&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;action_s&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Detected&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Matched&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;summarize&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Events&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Requests&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dcount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;transactionId_s&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Paths&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;make_set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;requestUri_s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;by&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ruleId_s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ruleGroup_s&lt;/span&gt;
&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;order&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;by&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Events&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;desc&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The current &lt;a href="https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/agwfirewalllogs"&gt;&lt;code&gt;AGWFirewallLogs&lt;/code&gt; schema&lt;/a&gt; records the policy ID, policy scope and transaction ID. The transaction ID joins several rule events produced by one request.&lt;/p&gt;
&lt;p&gt;Open the highest-volume group first. Inspect several transactions and compare each rule message with the input the application expects.&lt;/p&gt;
&lt;h2&gt;Find the field that caused the match&lt;/h2&gt;
&lt;p&gt;Suppose rule &lt;code&gt;942100&lt;/code&gt; appears on &lt;code&gt;POST /api/messages&lt;/code&gt;. The endpoint accepts customer support text, and messages containing database errors trigger the SQL injection rule.&lt;/p&gt;
&lt;p&gt;The &lt;a href="/blog/how-to-tune-your-waf/"&gt;general WAF tuning guide&lt;/a&gt; explains how to classify the match. The Azure log supplies the rule, field and policy.&lt;/p&gt;
&lt;p&gt;Confirm four things before adding an exception:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the same field causes the repeated matches;&lt;/li&gt;
&lt;li&gt;the application expects free text in that field;&lt;/li&gt;
&lt;li&gt;the requests complete normally in Detection mode;&lt;/li&gt;
&lt;li&gt;other fields on the endpoint still need SQL injection inspection.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The development team supplies the application context behind the WAF event. Ask how the field is parsed, validated, stored and rendered. Keep the request examples needed for the investigation, then remove any customer content from the exception record.&lt;/p&gt;
&lt;h2&gt;Exclude one field from one rule&lt;/h2&gt;
&lt;p&gt;Azure exclusion lists remove selected request attributes from managed-rule inspection while the WAF evaluates the rest of the request. Application Gateway v2 can exclude request headers, cookies, form fields, JSON entities and query-string arguments. Exclusions can apply globally or to selected managed rules. &lt;a href="https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/application-gateway-waf-configuration"&gt;Microsoft’s exclusion-list guide describes the supported fields and per-rule configuration&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For the message example, select &lt;code&gt;RequestArgValues&lt;/code&gt; with the selector &lt;code&gt;message&lt;/code&gt;, then limit the exclusion to rule &lt;code&gt;942100&lt;/code&gt; in the deployed CRS or DRS version. Replay the original request and a second request that places SQL injection text in another field. The support message should pass. The second field should still trigger the rule.&lt;/p&gt;
&lt;p&gt;Azure now skips &lt;code&gt;message&lt;/code&gt; for rule &lt;code&gt;942100&lt;/code&gt; and inspects the other request fields.&lt;/p&gt;
&lt;p&gt;Per-rule exclusions require the next-generation WAF engine with CRS 3.2, DRS 2.1 or a later ruleset. Microsoft currently recommends DRS 2.2. A global exclusion applies across the web application covered by the policy, so reserve it for a field that has the same meaning everywhere. &lt;a href="https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/application-gateway-waf-configuration"&gt;Microsoft lists these version requirements and exclusion behaviour in the Application Gateway WAF documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Give one site or path its own policy&lt;/h2&gt;
&lt;p&gt;A policy-level exclusion may cover more applications than the exception requires.&lt;/p&gt;
&lt;p&gt;Application Gateway can associate WAF policies globally, with a listener, or with a path-based rule. The most specific policy takes precedence. A listener policy can therefore tune one hostname, while a path policy can tune one URL area. &lt;a href="https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/per-site-policies"&gt;Microsoft documents global, per-site and per-URI policy associations&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Use that layout when &lt;code&gt;message&lt;/code&gt; is free text on &lt;code&gt;/api/messages&lt;/code&gt; and a structured identifier elsewhere. Put the exclusion in the policy attached to the relevant path. Other listeners and paths keep their existing policy.&lt;/p&gt;
&lt;p&gt;Record the association alongside the exception. A future routing change can move traffic under a different policy without changing the exception itself.&lt;/p&gt;
&lt;h2&gt;Use request exceptions to skip a rule&lt;/h2&gt;
&lt;p&gt;Azure Application Gateway WAF also has request exceptions. They match a request attribute such as a URI, header or client address, then bypass a selected rule, rule group or ruleset for the matching request.&lt;/p&gt;
&lt;p&gt;Use a request exception when one rule cannot inspect any part of a known request safely. The selected rule stops evaluating the matching request, so describe the inspection removed and limit the exception to that rule where possible.&lt;/p&gt;
&lt;p&gt;As of July 2026, Application Gateway WAF request exceptions are in preview. They require Application Gateway v2 and the next-generation engine with CRS 3.2, DRS 2.1 or later. Each WAF policy supports up to 60 exceptions, subject to gateway and per-exception limits. Confirm availability, deployment tooling and support expectations before using them in production. &lt;a href="https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/application-gateway-exceptions"&gt;Microsoft publishes the current status, supported scopes and limits on the request-exceptions page&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;An Allow rule bypasses the managed WAF&lt;/h2&gt;
&lt;p&gt;When that rule matches, Azure skips the managed DRS, CRS and Bot Protection rulesets for the request. HTTP DDoS rules still run. &lt;a href="https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/application-gateway-exceptions#custom-rule-with-an-allow-action"&gt;Microsoft documents the exact consequence of a custom Allow action&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Reserve an &lt;code&gt;Allow&lt;/code&gt; rule for a tightly defined, trusted integration. Every matching request bypasses DRS, CRS and Bot Protection, including requests sent after an allowed client is compromised.&lt;/p&gt;
&lt;p&gt;Write the trust assumption into the rule description and the exception register. Include the owner, source, listener or path, expiry or review date, and the protections that remain.&lt;/p&gt;
&lt;h2&gt;Return to Prevention mode&lt;/h2&gt;
&lt;p&gt;Run the Detection policy until ordinary traffic and important manual flows produce no unexplained matches. Include login, password reset, checkout, file upload, API writes, administration and scheduled integrations.&lt;/p&gt;
&lt;p&gt;Then:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;save the current policy settings;&lt;/li&gt;
&lt;li&gt;change the mode to Prevention while preserving &lt;code&gt;requestBodyCheck&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;read the policy back;&lt;/li&gt;
&lt;li&gt;replay the requests used during tuning;&lt;/li&gt;
&lt;li&gt;monitor &lt;code&gt;Blocked&lt;/code&gt; events and 403 responses;&lt;/li&gt;
&lt;li&gt;keep a quick rollback procedure ready.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Enable Prevention in stages when separate listeners or applications have different risk. The first application may be clean while a monthly import on the second has never appeared in the logs.&lt;/p&gt;
&lt;p&gt;Recheck the same Log Analytics groups after application releases and managed-ruleset upgrades. A new field, content type or route changes what the WAF sees. Record the request, excluded field and owning policy for every exception.&lt;/p&gt;</content><category term="Application Security"></category><category term="WAF"></category><category term="Azure"></category><category term="Application Gateway"></category><category term="Application Security"></category><category term="False Positives"></category><category term="WAF Tuning"></category></entry></feed>