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
| Pricing: |**Microsoft Defender for open-source relational databases** is billed as shown on the [pricing page](https://azure.microsoft.com/pricing/details/defender-for-cloud/)|
26
-
| Protected versions of PostgreSQL: | Single Server - General Purpose and Memory Optimized. Learn more in [PostgreSQL pricing tiers](../postgresql/concepts-pricing-tiers.md). |
27
-
| Protected versions of MySQL: | Single Server - General Purpose and Memory Optimized. Learn more in [MySQL pricing tiers](../mysql/concepts-pricing-tiers.md). |
28
-
| Protected versions of MariaDB: | General Purpose and Memory Optimized. Learn more in [MariaDB pricing tiers](../mariadb/concepts-pricing-tiers.md). |
29
-
| Clouds: | :::image type="icon" source="./media/icons/yes-icon.png"::: Commercial clouds<br>:::image type="icon" source="./media/icons/no-icon.png"::: National (Azure Government, Azure China 21Vianet) |
30
-
|||
22
+
| Aspect | Details |
23
+
|--|:-|
24
+
| Release state: | General availability (GA) |
25
+
| Pricing: |**Microsoft Defender for open-source relational databases** is billed as shown on the [pricing page](https://azure.microsoft.com/pricing/details/defender-for-cloud/)|
26
+
| Protected versions of PostgreSQL: | Single Server - General Purpose and Memory Optimized. Learn more in [PostgreSQL pricing tiers](../postgresql/concepts-pricing-tiers.md). |
27
+
| Protected versions of MySQL: | Single Server - General Purpose and Memory Optimized. Learn more in [MySQL pricing tiers](../mysql/concepts-pricing-tiers.md). |
28
+
| Protected versions of MariaDB: | General Purpose and Memory Optimized. Learn more in [MariaDB pricing tiers](../mariadb/concepts-pricing-tiers.md). |
Copy file name to clipboardExpand all lines: articles/static-web-apps/configuration.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -316,6 +316,24 @@ In addition to IP address blocks, you can also specify [service tags](../virtual
316
316
*[Default authentication providers](authentication-authorization.md#login), don't require settings in the configuration file.
317
317
*[Custom authentication providers](authentication-custom.md) use the `auth` section of the settings file.
318
318
319
+
## Disable cache for authenticated paths
320
+
321
+
If you have enabled [enterprise-grade edge](enterprise-edge.md), or set up [manual integration with Azure Front Door](front-door-manual.md), you may want to disable caching for your secured routes.
322
+
323
+
To disable Azure Front Door caching for secured routes, add `"Cache-Control": "no-store"` to the route header definition.
324
+
325
+
For example:
326
+
327
+
```json
328
+
{
329
+
"route": "/members",
330
+
"allowedRoles": ["authenticated, members"],
331
+
"headers": {
332
+
"Cache-Control": "no-store"
333
+
}
334
+
}
335
+
```
336
+
319
337
## Forwarding gateway
320
338
321
339
The `forwardingGateway` section configures how a static web app is accessed from a forwarding gateway such as a CDN or Azure Front Door.
@@ -357,7 +375,7 @@ For example, the following configuration shows how you can add a unique identifi
357
375
358
376
- Key/value pairs can be any set of arbitrary strings
Copy file name to clipboardExpand all lines: articles/static-web-apps/front-door-manual.md
+88-44Lines changed: 88 additions & 44 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/12/2022
9
9
ms.author: cshoe
10
10
---
11
11
@@ -17,13 +17,13 @@ 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
-
## Copy URL
26
+
## Copy web app URL
27
27
28
28
1. Navigate to the Azure portal.
29
29
@@ -35,80 +35,104 @@ In this tutorial, you learn how to:
35
35
36
36
## Add Azure Front Door
37
37
38
-
1. Navigate to the Azure portal.
38
+
1. Navigate to the Azure home screen.
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*and not the plain *Front Door* option.
47
47
48
48
1. Select **Create**.
49
49
50
+
1. Select the **Azure Front Door Standard/Premium** option.
51
+
52
+
1. Select the **Quick create** option.
53
+
54
+
1. Select the **Continue to create a front door** button.
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 that you set aside from the beginning of this tutorial. 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
+
### Add a condition
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`) |
81
-
82
-
Accept the defaults for the rest of the form, and select **Add**.
85
+
1. Under *Settings*, select **Rule set**.
83
86
84
87
1. Select **Add**.
85
88
86
-
1.Select the **plus sign** next to *Routing rule*, and enter the following value:
89
+
1.In the *Rule set name* textbox, enter **Security**.
87
90
88
-
| Setting | Value |
89
-
|---|---|
90
-
| Name | Enter **my-routing-rule**. |
91
+
1. In the *Rule name* textbox, enter **NoCacheAuthRequests**.
91
92
92
-
Accept the defaults for the rest of the form, and select **Add**.
93
+
1. Select **Add a condition**.
93
94
94
-
1. Select **Review + create**.
95
+
1. Select **Request path**.
95
96
96
-
1. Select **Create**.
97
+
1. Select **Begins With** in the *Operator* drop down.
97
98
98
-
The creation process may take a few minutes to complete.
99
+
1. Select the **Edit** link above the *Value* textbox.
99
100
100
-
1.Select**Go to resource**.
101
+
1.Enter**/.auth** in the textbox.
101
102
102
-
1. Select **Overview**.
103
+
1. Select the **Update** button.
103
104
104
-
1. Select the link labeled *Frontend host*.
105
+
1. Select the **No transform** option from the *Case transform* dropdown.
105
106
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*.
107
+
### Add an action
107
108
108
-
1. From the *Overview* window, copy the value labeled **Front Door ID** and paste it into a file for later use.
109
+
1. Select the **Add an action** dropdown.
110
+
111
+
1. Select **Cache expiration**.
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 **Bypass cache** in the *Cache Behavior* dropdown.
114
+
115
+
1. Select the **Save** button.
116
+
117
+
### Associate rule to an endpoint
118
+
119
+
Now that the rule is created, you apply the rule to a Front Door endpoint.
120
+
121
+
1. Select the **Unassociated** link.
122
+
123
+
1. Select the Endpoint name to which you want to apply the caching rule.
124
+
125
+
1. Select the **Next** button.
126
+
127
+
1. Select the **Associate** button.
128
+
129
+
## Copy Front Door ID
130
+
131
+
Use the following steps to copy the Front Door instance's unique identifier.
132
+
133
+
1. Select the **Overview** link on the left-hand navigation.
134
+
135
+
1. From the *Overview* window, copy the value labeled **Front Door ID** and paste it into a file for later use.
112
136
113
137
## Update static web app configuration
114
138
@@ -117,6 +141,7 @@ To complete the integration with Front Door, you need to update the application
117
141
- Restrict traffic to your site only through Front Door
118
142
- Restrict traffic to your site only from your Front Door instance
119
143
- Define which domains can access your site
144
+
- Disable caching for secured routes
120
145
121
146
Open the [staticwebapp.config.json](configuration.md) file for your site and make the following changes.
122
147
@@ -147,12 +172,31 @@ Open the [staticwebapp.config.json](configuration.md) file for your site and mak
147
172
148
173
In this example, replace `my-sitename.azurefd.net` with the Azure Front Door hostname for your site.
149
174
175
+
1. For all secured routes in your app, disable Azure Front Door caching by adding `"Cache-Control": "no-store"` to the route header definition.
176
+
177
+
```json
178
+
{
179
+
"route": "/members",
180
+
"allowedRoles": ["authenticated, members"],
181
+
"headers": {
182
+
"Cache-Control": "no-store"
183
+
}
184
+
}
185
+
```
186
+
150
187
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
188
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.
189
+
## Considerations
190
+
191
+
- **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.
192
+
193
+
- **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).
194
+
195
+
- **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.
196
+
197
+
## Clean up resources
154
198
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.
199
+
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