Skip to content

Commit 8e04c97

Browse files
committed
Addressing Zhenlan's feedback and a few other tweaks
1 parent 4824e55 commit 8e04c97

File tree

3 files changed

+31
-16
lines changed

3 files changed

+31
-16
lines changed

articles/azure-app-configuration/enable-dynamic-configuration-aspnet-core.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ A *sentinel key* is a special key used to signal when configuration has changed.
7777
config.AddAzureAppConfiguration(options =>
7878
{
7979
options.Connect(settings["ConnectionStrings:AppConfig"])
80-
.ConfigureRefresh(refresh =>
80+
.ConfigureRefresh(refresh =>
8181
{
8282
refresh.Register("TestApp:Settings:Sentinel", refreshAll: true)
83-
.SetCacheExpiration(new TimeSpan(0, 0, 1));
83+
.SetCacheExpiration(new TimeSpan(0, 5, 0));
8484
});
8585
});
8686
})
@@ -97,27 +97,27 @@ A *sentinel key* is a special key used to signal when configuration has changed.
9797
{
9898
var settings = config.Build();
9999
config.AddAzureAppConfiguration(options =>
100-
{
100+
{
101101
options.Connect(settings["ConnectionStrings:AppConfig"])
102-
.ConfigureRefresh(refresh =>
102+
.ConfigureRefresh(refresh =>
103103
{
104104
refresh.Register("TestApp:Settings:Sentinel", refreshAll: true)
105-
.SetCacheExpiration(new TimeSpan(0, 0, 1));
105+
.SetCacheExpiration(new TimeSpan(0, 5, 0));
106106
});
107107
});
108108
})
109109
.UseStartup<Startup>());
110110
```
111111
---
112112
113-
The `ConfigureRefresh` method is used to specify the settings used to update the configuration data with the App Configuration store when a refresh operation is triggered. The `refreshAll` parameter to the `Register` method indicates that all configuration values should be refreshed if the sentinel key changes.
114-
115-
Also, the `SetCacheExpiration` method overrides the default cache expiration time of 30 seconds, specifying a time of 1 second instead.
113+
The `ConfigureRefresh` method is used to specify the settings used to update the configuration data with the App Configuration store when a refresh operation is triggered. The `refreshAll` parameter to the `Register` method indicates that all configuration values should be refreshed if the sentinel key changes.
116114
117-
> [!WARNING]
118-
> Use higher cache expiration times in production to avoid unnecessary requests to App Configuration.
119-
120-
To actually trigger a refresh operation, configure a refresh middleware for the application to refresh the configuration data when any change occurs.
115+
Also, the `SetCacheExpiration` method overrides the default cache expiration time of 30 seconds, specifying a time of 5 minutes instead. This reduces the number of requests made to App Configuration.
116+
117+
> [!NOTE]
118+
> For testing purposes, you may want to lower the cache expiration time.
119+
120+
To actually trigger a refresh operation, you'll need to configure a refresh middleware for the application to refresh the configuration data when any change occurs. You'll see how to do this in step #4.
121121
122122
2. Add a *Settings.cs* file that defines and implements a new `Settings` class.
123123
@@ -312,7 +312,7 @@ A *sentinel key* is a special key used to signal when configuration has changed.
312312
1. After the build successfully completes, run the following command to run the web app locally:
313313
314314
dotnet run
315-
1. Open a browser window, and go to `http://localhost:5000`, which is the default URL for the web app hosted locally.
315+
1. Open a browser window, and go to the URL shown in the `dotnet run` output.
316316
317317
![Launching quickstart app locally](./media/quickstarts/aspnet-core-app-launch-local-before.png)
318318

articles/azure-app-configuration/faq.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,22 @@ You can't downgrade a store from the Standard tier to the Free tier. You can cre
9595

9696
## Are there any limits on the number of requests made to App Configuration?
9797

98-
Configuration stores in the Free tier are limited to 1,000 requests per day. Configuration stores in the Standard tier may experience temporary throttling when the request rate exceeds 20,000 requests per hour. When a store reaches its limit, it will return HTTP status code 429 for all requests made until the time period expires.
98+
Configuration stores in the Free tier are limited to 1,000 requests per day. Configuration stores in the Standard tier may experience temporary throttling when the request rate exceeds 20,000 requests per hour.
9999

100-
If your application regularly experiences HTTP status code 429, consider redesigning it to reduce the number of requests made. For more information, see [Reduce requests made to App Configuration](./howto-best-practices.md#reduce-requests-made-to-app-configuration)
100+
When a store reaches its limit, it will return HTTP status code 429 for all requests made until the time period expires. The `retry-after-ms` header in the response gives a suggested wait time (in milliseconds) before retrying the request.
101+
102+
If your application regularly experiences HTTP status code 429 responses, consider redesigning it to reduce the number of requests made. For more information, see [Reduce requests made to App Configuration](./howto-best-practices.md#reduce-requests-made-to-app-configuration)
103+
104+
## My application receives HTTP status code 429 responses. Why?
105+
106+
You'll receive an HTTP status code 429 response under these circumstances:
107+
108+
* Exceeding the daily request limit for a store in the Free tier.
109+
* Temporary throttling due to a high request rate for a store in the Standard tier.
110+
* Excessive bandwidth usage.
111+
* Attempting to create or modify a key when the storage quote is exceeded.
112+
113+
Check the body of the 429 response for the specific reason why the request failed.
101114

102115
## How can I receive announcements on new releases and other information related to App Configuration?
103116

articles/azure-app-configuration/howto-best-practices.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ You can provide access to App Configuration for web apps or functions by using a
6969

7070
## Reduce requests made to App Configuration
7171

72-
If your application consistently experiences HTTP status code 429, consider redesigning it to reduce the number of requests made.
72+
Excessive requests to App Configuration can result in throttling or overage charges. To reduce the number of requests made:
7373

7474
* Increase the refresh timeout, especially if your configuration values do not change frequently. Specify a new refresh timeout using the [`SetCacheExpiration` method](/dotnet/api/microsoft.extensions.configuration.azureappconfiguration.azureappconfigurationrefreshoptions.setcacheexpiration).
7575

7676
* Watch a single *sentinel key*, rather than watching individual keys. Refresh all configuration only if the sentinel key changes. See [Use dynamic configuration in an ASP.NET Core app](enable-dynamic-configuration-aspnet-core.md) for an example.
7777

78+
* Use Azure Event Grid to receive notifications when configuration changes, rather than constantly polling for any changes. See [Route Azure App Configuration events to a web endpoint](./howto-app-configuration-event) for more information
79+
7880
## Next steps
7981

8082
* [Keys and values](./concept-key-value.md)

0 commit comments

Comments
 (0)