You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/static-web-apps/front-door-manual.md
+61-42Lines changed: 61 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: static-web-apps
5
5
author: craigshoemaker
6
6
ms.service: static-web-apps
7
7
ms.topic: how-to
8
-
ms.date: 09/20/2021
8
+
ms.date: 01/07/2022
9
9
ms.author: cshoe
10
10
---
11
11
@@ -17,11 +17,11 @@ In this tutorial, you learn how to:
17
17
18
18
> [!div class="checklist"]
19
19
>
20
-
> - Create an Azure Front Door instance
20
+
> - Create an Azure Front Door Standard/Premium instance
21
21
> - Associate Azure Front Door with your Azure Static Web Apps site
22
22
23
23
> [!NOTE]
24
-
> This tutorial requires the Azure Static Web Apps Standard plan.
24
+
> This tutorial requires the Azure Static Web Apps Standard and Azure Front Door Standard / Premium plans.
25
25
26
26
## Copy URL
27
27
@@ -39,76 +39,88 @@ In this tutorial, you learn how to:
39
39
40
40
1. Select **Create a resource**.
41
41
42
-
1. Search for **Azure Front Door**.
42
+
1. Search for **Front Door**.
43
43
44
-
1. Select **Front Door**.
44
+
1. Select **Front Door Standard/Premium**.
45
45
46
-
Make sure not to select the service labeled *Front Door Standard/Premium* as the steps for the Standard/Premium service differ from what's presented in this tutorial.
46
+
Make sure to select the service labeled *Front Door Standard/Premium*.
47
47
48
48
1. Select **Create**.
49
49
50
+
1. Select **Azure Front Door Standard/Premium (Preview)**.
51
+
52
+
1. Select **Quick create**.
53
+
54
+
1. Select **Continue to create a front door**.
55
+
50
56
1. In the *Basics* tab, enter the following values:
51
57
52
58
| Setting | Value |
53
59
|---|---|
54
60
| Subscription | Select your Azure subscription. |
55
61
| Resource group | Enter a resource group name. This name is often the same group name used by your static web app. |
56
62
| Resource group location | If you create a new resource group, enter the location nearest you. |
63
+
| Name | Enter **my-static-web-app-front-door**. |
64
+
| Tier | Select **Standard**. |
65
+
| Endpoint name | Enter a unique name for your Front Door host. |
66
+
| Origin type | Select **Custom**. |
67
+
| Origin host name | Enter the hostname of your static web app. Make sure your value does not include a trailing slash or protocol. (For example, `desert-rain-04056.azurestaticapps.net`) |
68
+
| Caching | Check the *Enable caching* checkbox. |
69
+
| Query string caching behavior | Select **Use Query string** from the dropdown. |
57
70
58
-
Select **Next: Configuration >**.
71
+
1.Select **Review + create**.
59
72
60
-
1.In the *Configuration* tab, select the **plus sign** next to *Frontends/domains*, and enter the following value:
73
+
1.Select **Create**.
61
74
62
-
| Setting | Value |
63
-
|---|---|
64
-
| Host name | Enter a unique name for your Front Door host. |
75
+
The creation process may take a few minutes to complete.
65
76
66
-
Accept the defaults for the rest of the form, and select **Add**.
77
+
1. Select **Go to resource**.
67
78
68
-
1. Select the **plus sign** next to *Backend pools*, and enter the following value:
79
+
## Disable cache for auth workflow
69
80
70
-
| Setting | Value |
71
-
|---|---|
72
-
| Name | Enter **my-static-web-app-pool**. |
81
+
Add the following settings to disable Front Door's caching policies from trying to cache authentication and authorization related pages.
73
82
74
-
1.Select **+ Add a backend**, and enter the following values:
83
+
1.Under *Settings*, select **Rule set**.
75
84
76
-
| Setting | Value |
77
-
|---|---|
78
-
| Backend host type | Select **Custom host**. |
79
-
| Backend host name | Enter the hostname of your static web app. Make sure your value does not include a trailing slash or protocol. (For example, `desert-rain-04056.azurestaticapps.net`) |
80
-
| Backend host header | Enter the hostname of your static web app. Make sure your value does not include a trailing slash protocol. (For example, `desert-rain-04056.azurestaticapps.net`) |
85
+
1. Select **Add**.
81
86
82
-
Accept the defaults for the rest of the form, and select **Add**.
87
+
1. In the *Rule set name* textbox, enter **Security**.
83
88
84
-
1.Select **Add**.
89
+
1.In the *Rule name* textbox, enter **NoCacheAuthRequests**.
85
90
86
-
1. Select the **plus sign** next to *Routing rule*, and enter the following value:
91
+
1. Select **Add a condition**.
87
92
88
-
| Setting | Value |
89
-
|---|---|
90
-
| Name | Enter **my-routing-rule**. |
93
+
1. Select **Request path**.
91
94
92
-
Accept the defaults for the rest of the form, and select **Add**.
95
+
1. Select **Begins With** in the *Operator* drop down.
93
96
94
-
1. Select **Review + create**.
97
+
1. Select the **Edit** link above the *Value* textbox.
95
98
96
-
1.Select**Create**.
99
+
1.Enter**/.auth** in the value textbox.
97
100
98
-
The creation process may take a few minutes to complete.
101
+
1. Select **Add an action**.
99
102
100
-
1. Select **Go to resource**.
103
+
1. Select **Cache expiration**.
101
104
102
-
1. Select **Overview**.
105
+
1. Select **Bypass cache** in the *Cache Behavior* dropdown.
103
106
104
-
1. Select the link labeled *Frontend host*.
107
+
1. Select **Save**.
105
108
106
-
When you select this link, you may see a 404 error if the site is not fully propagated. Instead of refreshing the page, wait a few minutes and return back to the *Overview* window and select the link labeled *Frontend host*.
109
+
1. Select the **Unassociated** link.
107
110
108
-
1.From the *Overview* window, copy the value labeled **Front Door ID** and paste it into a file for later use.
111
+
1.Select the Endpoint name you want to apply this rule.
109
112
110
-
> [!IMPORTANT]
111
-
> By default, Azure Front Door configures [health probes](../frontdoor/front-door-health-probes.md) that may affect your traffic statistics. You may want to edit the default values for the [health probes](../frontdoor/front-door-health-probes.md).
113
+
1. Select **Next**.
114
+
115
+
1. Select **Associate**.
116
+
117
+
## Copy Front Door ID
118
+
119
+
Use the following steps to copy the Front Door instance's unique identifier.
120
+
121
+
1. Select **Overview**.
122
+
123
+
1. From the *Overview* window, copy the value labeled **Front Door ID** and paste it into a file for later use.
112
124
113
125
## Update static web app configuration
114
126
@@ -149,10 +161,17 @@ Open the [staticwebapp.config.json](configuration.md) file for your site and mak
149
161
150
162
With this configuration, your site is no longer available via the generated `*.azurestaticapps.net` hostname, but exclusively through the hostnames configured in your Front Door instance.
151
163
152
-
> [!NOTE]
153
-
> When you deploy updates to existing files in your static web app, Azure Front Door may continue to serve older versions of your files until their [time-to-live](https://wikipedia.org/wiki/Time_to_live) expires. [Purge the Azure Front Door cache](../frontdoor/front-door-caching.md#cache-purge) for the affected paths to ensure the latest files are served.
164
+
## Considerations
165
+
166
+
- **Custom domains**: Now that Front Door is managing your site, you no long use the Azure Static Web Apps custom domain feature. Azure Front Door has a separate process for adding a custom domain. Refer to [Add a custom domain to your Front Door](../frontdoor/front-door-custom-domain.md). When you add a custom domain to Front Door, you'll need to update your static web app configuration file to include it in the `allowedForwardedHosts` list.
167
+
168
+
- **Traffic statistics**: By default, Azure Front Door configures [health probes](../frontdoor/front-door-health-probes.md) that may affect your traffic statistics. You may want to edit the default values for the [health probes](../frontdoor/front-door-health-probes.md).
169
+
170
+
- **Serving old versions**: When you deploy updates to existing files in your static web app, Azure Front Door may continue to serve older versions of your files until their [time-to-live](https://wikipedia.org/wiki/Time_to_live) expires. [Purge the Azure Front Door cache](../frontdoor/front-door-caching.md#cache-purge) for the affected paths to ensure the latest files are served.
171
+
172
+
## Clean up resources
154
173
155
-
Now that Front Door is managing your site, you no long use the Azure Static Web Apps custom domain feature. Azure Front Door has a separate process for adding a custom domain. Refer to [Add a custom domain to your Front Door](../frontdoor/front-door-custom-domain.md). When you add a custom domain to Front Door, you'll need to update your static web app configuration file to include it in the `allowedForwardedHosts` list.
174
+
If you no longer want to use the resources created in this tutorial, delete the Azure Static Web Apps and Azure Front Door instances.
0 commit comments