Skip to content

Commit ce6d6ef

Browse files
committed
Added more comments
1 parent fa1ca8b commit ce6d6ef

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

articles/azure-app-configuration/enable-dynamic-configuration-python.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ A *sentinel key* is a key that you update after you complete the change of all o
5151
# Setting up a configuration setting with a known value
5252
client = AzureAppConfigurationClient.from_connection_string(connection_string)
5353

54-
# Adding a configuration setting to be refreshed
54+
# Creating a configuration setting to be refreshed
5555
configuration_setting = ConfigurationSetting(key="message", value="Hello World!")
5656

57-
# Adding a Sentinel key to monitor
57+
# Creating a Sentinel key to monitor
5858
sentinel_setting = ConfigurationSetting(key="Sentinel", value="1")
5959

60+
# Setting the configuration setting in Azure App Configuration
6061
client.set_configuration_setting(configuration_setting=configuration_setting)
6162
client.set_configuration_setting(configuration_setting=sentinel_setting)
6263

@@ -67,16 +68,19 @@ A *sentinel key* is a key that you update after you complete the change of all o
6768
refresh_interval=1, # Default value is 30 seconds, shorted for this sample
6869
)
6970

71+
# Printing the initial value
7072
print(config["message"])
7173
print(config["Sentinel"])
7274

73-
# Updating the configuration setting
75+
# Updating the configuration setting to a new value
7476
configuration_setting.value = "Hello World Updated!"
7577

78+
# Updating the sentinel key to a new value, only after this is changed can a refresh happen
7679
sentinel_setting.value = "2"
7780

81+
# Setting the updated configuration setting in Azure App Configuration
7882
client.set_configuration_setting(configuration_setting=configuration_setting)
79-
client.set_configuration_setting(configuration_setting=sentinel_setting) # Unless this value is updated, the configuration will not be refreshed
83+
client.set_configuration_setting(configuration_setting=sentinel_setting) # Should always be done last to make sure all other keys included in the refresh
8084

8185
# Waiting for the refresh interval to pass
8286
time.sleep(2)

0 commit comments

Comments
 (0)