Skip to content

Commit f7a9984

Browse files
committed
PR comments
1 parent bd75a2b commit f7a9984

6 files changed

+57
-57
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ Finish the quickstart: [Create an ASP.NET Core app with App Configuration](./qui
3636
builder.Configuration.AddAzureAppConfiguration(options =>
3737
{
3838
options.Connect(new Uri(endpoint), new DefaultAzureCredential())
39-
// Load all keys that start with `TestApp:` and have no label.
40-
.Select("TestApp:*", LabelFilter.Null)
41-
// Reload configuration if any selected key-values have changed.
42-
.ConfigureRefresh(refreshOptions =>
43-
refreshOptions.RegisterAll());
39+
// Load all keys that start with `TestApp:` and have no label.
40+
.Select("TestApp:*", LabelFilter.Null)
41+
// Reload configuration if any selected key-values have changed.
42+
.ConfigureRefresh(refreshOptions =>
43+
refreshOptions.RegisterAll());
4444
});
4545
```
4646

@@ -100,7 +100,7 @@ You've set up your app to use the [options pattern in ASP.NET Core](/aspnet/core
100100

101101
## Request-driven configuration refresh
102102

103-
The configuration refresh is triggered by the incoming requests to your web app. No refresh will occur if your app is idle. When your app is active, the App Configuration middleware monitors any keys you registered for refreshing in the `ConfigureRefresh` call. The middleware is triggered upon every incoming request to your app. However, the middleware will only send requests to check the value in App Configuration when the cache expiration time you set has passed.
103+
The configuration refresh is triggered by the incoming requests to your web app. No refresh will occur if your app is idle. When your app is active, the App Configuration middleware monitors any keys you registered for refreshing in the `ConfigureRefresh` call. The middleware is triggered upon every incoming request to your app. However, the middleware will only send requests to check the value in App Configuration when the refresh interval you set has passed.
104104

105105
- If a request to App Configuration for change detection fails, your app will continue to use the cached configuration. New attempts to check for changes will be made periodically while there are new incoming requests to your app.
106106
- The configuration refresh happens asynchronously to the processing of your app's incoming requests. It will not block or slow down the incoming request that triggered the refresh. The request that triggered the refresh may not get the updated configuration values, but later requests will get new configuration values.

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ Add the following key-values to the App Configuration store and leave **Label**
9999
{
100100
string endpoint = Environment.GetEnvironmentVariable("Endpoint");
101101
options.Connect(new Uri(endpoint), new DefaultAzureCredential())
102-
// Load all keys that start with `TestApp:` and have no label.
103-
.Select("TestApp:*")
104-
// Reload configuration if any selected key-values have changed.
105-
.ConfigureRefresh(refresh =>
106-
{
107-
refresh.RegisterAll()
108-
.SetRefreshInterval(new TimeSpan(0, 5, 0));
109-
});
102+
// Load all keys that start with `TestApp:` and have no label.
103+
.Select("TestApp:*")
104+
// Reload configuration if any selected key-values have changed.
105+
.ConfigureRefresh(refresh =>
106+
{
107+
refresh.RegisterAll()
108+
.SetRefreshInterval(new TimeSpan(0, 5, 0));
109+
});
110110
_configurationRefresher = options.GetRefresher();
111111
});
112112

@@ -123,14 +123,14 @@ Add the following key-values to the App Configuration store and leave **Label**
123123
builder.AddAzureAppConfiguration(options =>
124124
{
125125
options.Connect(Environment.GetEnvironmentVariable("ConnectionString"))
126-
// Load all keys that start with `TestApp:` and have no label.
127-
.Select("TestApp:*")
128-
// Reload configuration if any selected key-values have changed.
129-
.ConfigureRefresh(refresh =>
130-
{
131-
refresh.RegisterAll()
132-
.SetRefreshInterval(new TimeSpan(0, 5, 0));
133-
});
126+
// Load all keys that start with `TestApp:` and have no label.
127+
.Select("TestApp:*")
128+
// Reload configuration if any selected key-values have changed.
129+
.ConfigureRefresh(refresh =>
130+
{
131+
refresh.RegisterAll()
132+
.SetRefreshInterval(new TimeSpan(0, 5, 0));
133+
});
134134
_configurationRefresher = options.GetRefresher();
135135
});
136136

@@ -155,9 +155,9 @@ Add the following key-values to the App Configuration store and leave **Label**
155155
```
156156
Calling the `ConfigureRefresh` method alone won't cause the configuration to refresh automatically. You call the `TryRefreshAsync` method at the beginning of every request to signal a refresh. This design ensures your application only sends requests to App Configuration when it is actively receiving requests.
157157

158-
Calling `TryRefreshAsync` is a no-op before the configured cache expiration time elapses, so its performance impact is minimal. When a request is made to App Configuration, as you don't wait on the task, the configuration is refreshed asynchronously without blocking the execution of the current request. The current request may not get the updated configuration values, but subsequent requests will do.
158+
Calling `TryRefreshAsync` is a no-op before the configured refresh interval elapses, so its performance impact is minimal. When a request is made to App Configuration, as you don't wait on the task, the configuration is refreshed asynchronously without blocking the execution of the current request. The current request may not get the updated configuration values, but subsequent requests will do.
159159

160-
If the call `TryRefreshAsync` fails for any reason, your application will continue to use the cached configuration. Another attempt will be made when the configured cache expiration time has passed again, and the `TryRefreshAsync` call is triggered by a new request to your application.
160+
If the call `TryRefreshAsync` fails for any reason, your application will continue to use the cached configuration. Another attempt will be made when the configured refresh interval has passed again, and the `TryRefreshAsync` call is triggered by a new request to your application.
161161

162162
## Use the latest configuration data
163163

@@ -268,7 +268,7 @@ Add the following key-values to the App Configuration store and leave **Label**
268268
| *TestApp:Settings:FontColor* | *LightGray* |
269269
| *TestApp:Settings:Message* | *Data from Azure App Configuration - now with live updates!* |
270270

271-
1. Refresh the browser page to see the new configuration settings. You may need to refresh more than once for the changes to be reflected or change your cache expiration time to less than 5 minutes.
271+
1. Refresh the browser page to see the new configuration settings. You may need to refresh more than once for the changes to be reflected or change your refresh interval to less than 5 minutes.
272272

273273
![App refresh local](./media/dotnet-fx-web-app-refresh.png)
274274

articles/azure-app-configuration/enable-dynamic-configuration-dotnet-background-service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ You use the [.NET command-line interface (CLI)](/dotnet/core/tools/) to create a
168168
}
169169
```
170170
171-
Calling the `ConfigureRefresh` method alone won't cause the configuration to refresh automatically. You call the `TryRefreshAsync` method from the interface `IConfigurationRefresher` to trigger a refresh. This design is to avoid requests sent to App Configuration even when your application is idle. You can include the `TryRefreshAsync` call where you consider your application active. For example, it can be when you process an incoming message, an order, or an iteration of a complex task. It can also be in a timer if your application is active all the time. In this example, you call `TryRefreshAsync` every time the background service is executed. Note that, even if the call `TryRefreshAsync` fails for any reason, your application will continue to use the cached configuration. Another attempt will be made when the configured cache expiration time has passed and the `TryRefreshAsync` call is triggered by your application activity again. Calling `TryRefreshAsync` is a no-op before the configured cache expiration time elapses, so its performance impact is minimal, even if it's called frequently.
171+
Calling the `ConfigureRefresh` method alone won't cause the configuration to refresh automatically. You call the `TryRefreshAsync` method from the interface `IConfigurationRefresher` to trigger a refresh. This design is to avoid requests sent to App Configuration even when your application is idle. You can include the `TryRefreshAsync` call where you consider your application active. For example, it can be when you process an incoming message, an order, or an iteration of a complex task. It can also be in a timer if your application is active all the time. In this example, you call `TryRefreshAsync` every time the background service is executed. Note that, even if the call `TryRefreshAsync` fails for any reason, your application will continue to use the cached configuration. Another attempt will be made when the configured refresh interval has passed and the `TryRefreshAsync` call is triggered by your application activity again. Calling `TryRefreshAsync` is a no-op before the configured refresh interval elapses, so its performance impact is minimal, even if it's called frequently.
172172
173173
## Build and run the app locally
174174

articles/azure-app-configuration/enable-dynamic-configuration-dotnet-core-push-refresh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ namespace TestConsole
173173
}
174174
```
175175

176-
The `ProcessPushNotification` method resets the cache expiration to a short random delay. This causes future calls to `RefreshAsync` or `TryRefreshAsync` to re-validate the cached values against App Configuration and update them as necessary. In this example you register to monitor changes to all selected key-values (*TestApp:Settings:Message*) with a cache expiration of one day. This means no request to App Configuration will be made before a day has passed since the last check. By calling `ProcessPushNotification` your application will send requests to App Configuration in the next few seconds. Your application will load the new configuration values shortly after changes occur in the `App Configuration` store without the need to constantly poll for updates. In case your application misses the change notification for any reason, it will still check for configuration changes once a day.
176+
The `ProcessPushNotification` method resets the refresh interval to a short random delay. This causes future calls to `RefreshAsync` or `TryRefreshAsync` to re-validate the cached values against App Configuration and update them as necessary. In this example you register to monitor changes to all selected key-values (*TestApp:Settings:Message*) with a refresh interval of one day. This means no request to App Configuration will be made before a day has passed since the last check. By calling `ProcessPushNotification` your application will send requests to App Configuration in the next few seconds. Your application will load the new configuration values shortly after changes occur in the `App Configuration` store without the need to constantly poll for updates. In case your application misses the change notification for any reason, it will still check for configuration changes once a day.
177177

178-
The short random delay for cache expiration is helpful if you have many instances of your application or microservices connecting to the same App Configuration store with the push model. Without this delay, all instances of your application could send requests to your App Configuration store simultaneously as soon as they receive a change notification. This can cause the App Configuration Service to throttle your store. Cache expiration delay is set to a random number between 0 and a maximum of 30 seconds by default, but you can change the maximum value through the optional parameter `maxDelay` to the `ProcessPushNotification` method.
178+
The short random delay for refresh interval is helpful if you have many instances of your application or microservices connecting to the same App Configuration store with the push model. Without this delay, all instances of your application could send requests to your App Configuration store simultaneously as soon as they receive a change notification. This can cause the App Configuration Service to throttle your store. refresh interval delay is set to a random number between 0 and a maximum of 30 seconds by default, but you can change the maximum value through the optional parameter `maxDelay` to the `ProcessPushNotification` method.
179179

180180
The `ProcessPushNotification` method takes in a `PushNotification` object containing information about which change in App Configuration triggered the push notification. This helps ensure all configuration changes up to the triggering event are loaded in the following configuration refresh. The `SetDirty` method does not guarantee the change that triggers the push notification to be loaded in an immediate configuration refresh. If you are using the `SetDirty` method for the push model, we recommend using the `ProcessPushNotification` method instead.
181181

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ builder.AddAzureAppConfiguration(options =>
5050
{
5151
string endpoint = Environment.GetEnvironmentVariable("Endpoint");
5252
options.Connect(new Uri(endpoint), new DefaultAzureCredential())
53-
// Load the key-value with key "TestApp:Settings:Message" and no label
54-
.Select("TestApp:Settings:Message")
55-
// Reload configuration if any selected key-values have changed.
56-
.ConfigureRefresh(refresh =>
57-
{
58-
refresh.RegisterAll()
59-
.SetRefreshInterval(TimeSpan.FromSeconds(10));
60-
});
53+
// Load the key-value with key "TestApp:Settings:Message" and no label
54+
.Select("TestApp:Settings:Message")
55+
// Reload configuration if any selected key-values have changed.
56+
.ConfigureRefresh(refresh =>
57+
{
58+
refresh.RegisterAll()
59+
.SetRefreshInterval(TimeSpan.FromSeconds(10));
60+
})
6161

6262
_refresher = options.GetRefresher();
6363
});
@@ -81,7 +81,7 @@ Inside the `ConfigureRefresh` method, you call the `RegisterAll` method to instr
8181

8282
The `SetRefreshInterval` method specifies the minimum time that must elapse before a new request is made to App Configuration to check for any configuration changes. In this example, you override the default expiration time of 30 seconds, specifying a time of 10 seconds instead for demonstration purposes.
8383

84-
Calling the `ConfigureRefresh` method alone won't cause the configuration to refresh automatically. You call the `TryRefreshAsync` method from the interface `IConfigurationRefresher` to trigger a refresh. This design is to avoid requests sent to App Configuration even when your application is idle. You'll want to include the `TryRefreshAsync` call where you consider your application active. For example, it can be when you process an incoming message, an order, or an iteration of a complex task. It can also be in a timer if your application is active all the time. In this example, you call `TryRefreshAsync` every time you press the Enter key. Even if the call `TryRefreshAsync` fails for any reason, your application continues to use the cached configuration. Another attempt is made when the configured cache expiration time has passed and the `TryRefreshAsync` call is triggered by your application activity again. Calling `TryRefreshAsync` is a no-op before the configured cache expiration time elapses, so its performance impact is minimal, even if it's called frequently.
84+
Calling the `ConfigureRefresh` method alone won't cause the configuration to refresh automatically. You call the `TryRefreshAsync` method from the interface `IConfigurationRefresher` to trigger a refresh. This design is to avoid requests sent to App Configuration even when your application is idle. You'll want to include the `TryRefreshAsync` call where you consider your application active. For example, it can be when you process an incoming message, an order, or an iteration of a complex task. It can also be in a timer if your application is active all the time. In this example, you call `TryRefreshAsync` every time you press the Enter key. Even if the call `TryRefreshAsync` fails for any reason, your application continues to use the cached configuration. Another attempt is made when the configured refresh interval has passed and the `TryRefreshAsync` call is triggered by your application activity again. Calling `TryRefreshAsync` is a no-op before the configured refresh interval elapses, so its performance impact is minimal, even if it's called frequently.
8585

8686
### Configuration refresh using dependency injection
8787

@@ -170,7 +170,7 @@ In the previous code, you're manually saving an instance of `IConfigurationRefre
170170
![Quickstart app refresh local](./media/quickstarts/dotnet-core-app-run-refresh.png)
171171

172172
> [!NOTE]
173-
> Since the cache expiration time was set to 10 seconds using the `SetRefreshInterval` method while specifying the configuration for the refresh operation, the value for the configuration setting will only be updated if at least 10 seconds have elapsed since the last refresh for that setting.
173+
> Since the refresh interval was set to 10 seconds using the `SetRefreshInterval` method while specifying the configuration for the refresh operation, the value for the configuration setting will only be updated if at least 10 seconds have elapsed since the last refresh for that setting.
174174

175175
## Logging and monitoring
176176

0 commit comments

Comments
 (0)