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
// 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());
44
44
});
45
45
```
46
46
@@ -100,7 +100,7 @@ You've set up your app to use the [options pattern in ASP.NET Core](/aspnet/core
100
100
101
101
## Request-driven configuration refresh
102
102
103
-
Theconfigurationrefreshistriggeredbytheincomingrequeststoyourwebapp. Norefreshwilloccurifyourappisidle. Whenyourappisactive, theAppConfigurationmiddlewaremonitorsanykeysyouregisteredfor 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
+
Theconfigurationrefreshistriggeredbytheincomingrequeststoyourwebapp. Norefreshwilloccurifyourappisidle. Whenyourappisactive, theAppConfigurationmiddlewaremonitorsanykeysyouregisteredfor 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.
104
104
105
105
- 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.
106
106
- 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.
// 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(newTimeSpan(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(newTimeSpan(0, 5, 0));
133
+
});
134
134
_configurationRefresher=options.GetRefresher();
135
135
});
136
136
@@ -155,9 +155,9 @@ Add the following key-values to the App Configuration store and leave **Label**
155
155
```
156
156
Callingthe `ConfigureRefresh` methodalonewon'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.
157
157
158
-
Calling `TryRefreshAsync` isano-opbeforetheconfiguredcacheexpirationtimeelapses, soitsperformanceimpactisminimal. WhenarequestismadetoAppConfiguration, asyoudon'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` isano-opbeforetheconfiguredrefreshintervalelapses, soitsperformanceimpactisminimal. WhenarequestismadetoAppConfiguration, asyoudon'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.
159
159
160
-
Ifthecall `TryRefreshAsync` failsfor 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
+
Ifthecall `TryRefreshAsync` failsfor 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.
161
161
162
162
## Use the latest configuration data
163
163
@@ -268,7 +268,7 @@ Add the following key-values to the App Configuration store and leave **Label**
1. Refreshthebrowserpagetoseethenewconfigurationsettings. Youmayneedtorefreshmorethanoncefor the changes to be reflected or change your cache expiration time to less than 5 minutes.
271
+
1. Refreshthebrowserpagetoseethenewconfigurationsettings. Youmayneedtorefreshmorethanoncefor the changes to be reflected or change your refresh interval to less than 5 minutes.
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/enable-dynamic-configuration-dotnet-background-service.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,7 +168,7 @@ You use the [.NET command-line interface (CLI)](/dotnet/core/tools/) to create a
168
168
}
169
169
```
170
170
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.
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/enable-dynamic-configuration-dotnet-core-push-refresh.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,9 +173,9 @@ namespace TestConsole
173
173
}
174
174
```
175
175
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.
177
177
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.
179
179
180
180
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.
// 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
+
})
61
61
62
62
_refresher=options.GetRefresher();
63
63
});
@@ -81,7 +81,7 @@ Inside the `ConfigureRefresh` method, you call the `RegisterAll` method to instr
81
81
82
82
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.
83
83
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.
85
85
86
86
### Configuration refresh using dependency injection
87
87
@@ -170,7 +170,7 @@ In the previous code, you're manually saving an instance of `IConfigurationRefre
0 commit comments