Skip to content

Commit 23d7709

Browse files
authored
Merge pull request #190860 from duongau/rulesengine
AFD Rules engine architecture - merge to AFD
2 parents 9cc9918 + 85c202f commit 23d7709

15 files changed

+85
-90
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,11 @@
693693
"redirect_url": "/azure/frontdoor/front-door-rules-engine-actions",
694694
"redirect_document_id": false
695695
},
696+
{
697+
"source_path_from_root": "/articles/frontdoor/concept-rules-set.md",
698+
"redirect_url": "/azure/frontdoor/front-door-rules-engine",
699+
"redirect_document_id": false
700+
},
696701
{
697702
"source_path_from_root": "/articles/app-service-web/web-sites-dotnet-deploy-aspnet-mvc-app-membership-oauth-sql-database.md",
698703
"redirect_url": "/aspnet/core/security/authorization/secure-data",

articles/frontdoor/front-door-routing-architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ The route specifies the [backend pool](front-door-backend-pool.md) that the requ
9797

9898
## Evaluate rule sets
9999

100-
If you have defined [rule sets](standard-premium/concept-rule-set.md) for the route, they're executed in the order they're configured. [Rule sets can override the origin group](front-door-rules-engine-actions.md#origin-group-override) specified in a route. Rule sets can also trigger a redirection response to the request instead of forwarding it to an origin.
100+
If you have defined [rule sets](front-door-rules-engine.md) for the route, they're executed in the order they're configured. [Rule sets can override the origin group](front-door-rules-engine-actions.md#origin-group-override) specified in a route. Rule sets can also trigger a redirection response to the request instead of forwarding it to an origin.
101101

102102
::: zone-end
103103

articles/frontdoor/front-door-rules-engine-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ zone_pivot_groups: front-door-tiers
1515

1616
::: zone pivot="front-door-standard-premium"
1717

18-
An Azure Front Door Standard/Premium [Rule Set](standard-premium/concept-rule-set.md) consist of rules with a combination of match conditions and actions. This article provides a detailed description of the actions you can use in Azure Front Door Standard/Premium Rule Set. The action defines the behavior that gets applied to a request type that a match condition(s) identifies. In an Azure Front Door (Standard/Premium) Rule Set, a rule can contain up to five actions.
18+
An Azure Front Door Standard/Premium [Rule Set](front-door-rules-engine.md) consist of rules with a combination of match conditions and actions. This article provides a detailed description of the actions you can use in Azure Front Door Standard/Premium Rule Set. The action defines the behavior that gets applied to a request type that a match condition(s) identifies. In an Azure Front Door (Standard/Premium) Rule Set, a rule can contain up to five actions.
1919

2020
> [!IMPORTANT]
2121
> Azure Front Door Standard/Premium (Preview) is currently in public preview.

articles/frontdoor/front-door-rules-engine.md

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,81 @@
22
title: Rules Engine for Azure Front Door architecture and terminology
33
description: This article provides an overview of the Azure Front Door Rules Engine feature.
44
services: frontdoor
5-
documentationcenter: ''
65
author: duongau
7-
editor: ''
86
ms.service: frontdoor
97
ms.topic: article
10-
ms.tgt_pltfrm: na
118
ms.workload: infrastructure-services
12-
ms.date: 9/29/2020
9+
ms.date: 03/07/2022
1310
ms.author: duau
14-
# Customer intent: As an IT admin, I want to learn about Front Door and what the Rules Engine feature does.
11+
zone_pivot_groups: front-door-tiers
1512
---
1613

1714
# What is Rules Engine for Azure Front Door?
1815

16+
::: zone pivot="front-door-standard-premium"
17+
18+
A Rule Set is a customized rule engine that groups a combination of rules into a single set. You can associate a Rule Set with multiple routes. The Rule Set allows you to customize how requests get processed at the edge, and how Azure Front Door handles those requests.
19+
20+
> [!IMPORTANT]
21+
> Azure Front Door Standard/Premium (Preview) is currently in public preview.
22+
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
23+
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
24+
25+
## Common supported scenarios
26+
27+
* Implementing security headers to prevent browser-based vulnerabilities like HTTP Strict-Transport-Security (HSTS), X-XSS-Protection, Content-Security-Policy, X-Frame-Options, and Access-Control-Allow-Origin headers for Cross-Origin Resource Sharing (CORS) scenarios. Security-based attributes can also be defined with cookies.
28+
29+
* Route requests to mobile or desktop versions of your application based on the client device type.
30+
31+
* Using redirect capabilities to return 301, 302, 307, and 308 redirects to the client to direct them to new hostnames, paths, query strings, or protocols.
32+
33+
* Dynamically modify the caching configuration of your route based on the incoming requests.
34+
35+
* Rewrite the request URL path and forwards the request to the appropriate origin in your configured origin group.
36+
37+
* Add, modify, or remove request/response header to hide sensitive information or capture important information through headers.
38+
39+
* Support server variables to dynamically change the request/response headers or URL rewrite paths/query strings, for example, when a new page load or when a form is posted. Server variable is currently supported on **[Rule Set actions](front-door-rules-engine-actions.md)** only.
40+
41+
## Architecture
42+
43+
Rule Set handles requests at the edge. When a request arrives at your Azure Front Door Standard/Premium endpoint, WAF is executed first, followed by the settings configured in Route. Those settings include the Rule Set associated to the Route. Rule Sets are processed from top to bottom in the Route. The same applies to rules within a Rule Set. In order for all the actions in each rule to get executed, all the match conditions within a rule has to be satisfied. If a request doesn't match any of the conditions in your Rule Set configuration, then only configurations in Route will be executed.
44+
45+
If **Stop evaluating remaining rules** gets checked, then all of the remaining Rule Sets associated with the Route aren't executed.
46+
47+
### Example
48+
49+
In the following diagram, WAF policies get executed first. A Rule Set gets configured to append a response header. Then the header changes the max-age of the cache control if the match condition gets met.
50+
51+
:::image type="content" source="./media/front-door-rules-engine/front-door-rule-set-architecture-1.png" alt-text="Diagram that shows architecture of Rule Set." lightbox="./media/front-door-rules-engine/front-door-rule-set-architecture-1-expanded.png":::
52+
53+
## Terminology
54+
55+
With Azure Front Door Rule Set, you can create a combination of Rules Set configuration, each composed of a set of rules. The following out lines some helpful terminologies you'll come across when configuring your Rule Set.
56+
57+
For more quota limit, refer to [Azure subscription and service limits, quotas and constraints](../azure-resource-manager/management/azure-subscription-service-limits.md).
58+
59+
* *Rule Set*: A set of rules that gets associated to one or multiple [routes](standard-premium/concept-route.md).
60+
61+
* *Rule Set rule*: A rule composed of up to 10 match conditions and 5 actions. Rules are local to a Rule Set and cannot be exported to use across Rule Sets. Users can create the same rule in multiple Rule Sets.
62+
63+
* *Match condition*: There are many match conditions that can be utilized to parse your incoming requests. A rule can contain up to 10 match conditions. Match conditions are evaluated with an **AND** operator. *Regular expression is supported in conditions*. A full list of match conditions can be found in [Rule Set match conditions](rules-match-conditions.md).
64+
65+
* *Action*: Actions dictate how AFD handles the incoming requests based on the matching conditions. You can modify caching behaviors, modify request headers/response headers, do URL rewrite and URL redirection. *Server variables are supported on Action*. A rule can contain up to 10 match conditions. A full list of actions can be found [Rule Set actions](front-door-rules-engine-actions.md).
66+
67+
## ARM template support
68+
69+
Rule Sets can be configured using Azure Resource Manager templates. [See an example template](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.cdn/front-door-standard-premium-rule-set). You can customize the behavior by using the JSON or Bicep snippets included in the documentation examples for [match conditions](rules-match-conditions.md) and [actions](front-door-rules-engine-actions.md).
70+
71+
## Next steps
72+
73+
* Learn how to [create a Front Door Standard/Premium](standard-premium/create-front-door-portal.md).
74+
* Learn how to configure your first [Rule Set](standard-premium/how-to-configure-rule-set.md).
75+
76+
::: zone-end
77+
78+
::: zone pivot="front-door-classic"
79+
1980
Rules Engine allows you to customize how HTTP requests gets handled at the edge and provides a more controlled behavior to your web application. Rules Engine for Azure Front Door has several key features, including:
2081

2182
* Enforces HTTPS to ensure all your end users interact with your content over a secure connection.
@@ -54,3 +115,5 @@ With AFD Rules Engine, you can create a combination of Rules Engine configuratio
54115
- Learn how to configure your first [Rules Engine configuration](front-door-tutorial-rules-engine.md).
55116
- Learn how to [create a Front Door](quickstart-create-front-door.md).
56117
- Learn [how Front Door works](front-door-routing-architecture.md).
118+
119+
::: zone-end

articles/frontdoor/rules-match-conditions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ zone_pivot_groups: front-door-tiers
1414

1515
::: zone pivot="front-door-standard-premium"
1616

17-
In Azure Front Door Standard/Premium [rule sets](standard-premium/concept-rule-set.md), a rule consists of none or some match conditions and an action. This article provides detailed descriptions of match conditions you can use in Azure Front Door rule sets.
17+
In Azure Front Door Standard/Premium [rule sets](front-door-rules-engine.md), a rule consists of none or some match conditions and an action. This article provides detailed descriptions of match conditions you can use in Azure Front Door rule sets.
1818

1919
::: zone-end
2020

@@ -1508,7 +1508,7 @@ For rules that can transform strings, the following transforms are valid:
15081508

15091509
::: zone pivot="front-door-standard-premium"
15101510

1511-
* Learn more about Azure Front Door Standard/Premium [Rule Set](standard-premium/concept-rule-set.md).
1511+
* Learn more about Azure Front Door Standard/Premium [Rule Set](front-door-rules-engine.md).
15121512
* Learn how to [configure your first Rule Set](standard-premium/how-to-configure-rule-set.md).
15131513
* Learn more about [Rule actions](front-door-rules-engine-actions.md).
15141514

articles/frontdoor/standard-premium/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
- name: Rule Engine
5353
items:
5454
- name: Rules Engine architecture
55-
href: concept-rule-set.md
55+
href: ../front-door-rules-engine.md?toc=%2fazure%2ffrontdoor%2fstandard-premium%2ftoc.json
5656
- name: Rules match conditions
5757
href: ../rules-match-conditions.md?toc=%2fazure%2ffrontdoor%2fstandard-premium%2ftoc.json
5858
- name: Rules actions

articles/frontdoor/standard-premium/concept-route.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A Front Door Standard/Premium routing configuration is composed of two major par
2525
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
2626
2727
> [!NOTE]
28-
> When you use the [Front Door rules engine](concept-rule-set.md), you can configure a rule to [override the origin group](../front-door-rules-engine-actions.md#origin-group-override) for a request. The origin group set by the rules engine overrides the routing process described in this article.
28+
> When you use the [Front Door rules engine](../front-door-rules-engine.md), you can configure a rule to [override the origin group](../front-door-rules-engine-actions.md#origin-group-override) for a request. The origin group set by the rules engine overrides the routing process described in this article.
2929
3030
### Incoming match (left-hand side)
3131

@@ -133,7 +133,7 @@ Given that configuration, the following example matching table would result:
133133

134134
Once Azure Front Door Standard/Premium has matched to a single routing rule, it then needs to choose how to process the request. If Azure Front Door Standard/Premium has a cached response available for the matched routing rule, then the request gets served back to the client.
135135

136-
Finally, Azure Front Door Standard/Premium evaluates whether or not you have a [rule set](concept-rule-set.md) for the matched routing rule. If there's no rule set defined, then the request gets forwarded to the origin group as-is. Otherwise, the rule sets get executed in the order they're configured. [Rule sets can override the route](../front-door-rules-engine-actions.md#origin-group-override), forcing traffic to a specific origin group.
136+
Finally, Azure Front Door Standard/Premium evaluates whether or not you have a [rule set](../front-door-rules-engine.md) for the matched routing rule. If there's no rule set defined, then the request gets forwarded to the origin group as-is. Otherwise, the rule sets get executed in the order they're configured. [Rule sets can override the route](../front-door-rules-engine-actions.md#origin-group-override), forcing traffic to a specific origin group.
137137

138138
## Next steps
139139

articles/frontdoor/standard-premium/concept-rule-set-url-redirect-and-rewrite.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ For example, if I set **Preserve unmatched path to No**.
9292

9393
## Next steps
9494

95-
* Learn more about [Azure Front Door Standard/Premium Rule Set](concept-rule-set.md).
95+
* Learn more about [Azure Front Door Standard/Premium Rule Set](../front-door-rules-engine.md).

0 commit comments

Comments
 (0)