- Package Name: azure-appconfiguration-provider
- Package Version: 2.5.1
- Operating System: macOS
- Python Version: 3.14
Describe the bug
After the last feature flag matching the configured selector is deleted from Azure App Configuration,
AzureAppConfigurationProvider.refresh() keeps the old feature flag data in memory instead of updating the provider state to an empty list.
To Reproduce
Steps to reproduce the behavior:
- Create a feature flag:
test_1 in Azure.
- Load configuration with
feature_flag_enabled=True and feature_flag_refresh_enabled=True.
- Delete
test_1 and call refresh().
- Inspect
config["feature_management"]["feature_flags"].
- Create a new provider with
load().
Actual behavior
After deleting the last flag test_1, refresh() still returns the stale test_1 entry.
A new load() call correctly returns an empty feature flag list.
Expected behavior
After the last matching feature flag is deleted, refresh() should update the provider state to an empty feature flag list.
Screenshots
Additional context
from azure.appconfiguration.provider import load
from azure.appconfiguration.provider._models import SettingSelector
CONNECTION_STRING = "..."
REFRESH_INTERVAL = 5
def load_config():
return load(
connection_string=CONNECTION_STRING,
feature_flag_enabled=True,
feature_flag_refresh_enabled=True,
feature_flag_selectors=[SettingSelector(key_filter="*", label_filter="my_custom_label")],
refresh_interval=REFRESH_INTERVAL,
)
config = load_config()
print(config["feature_management"]["feature_flags"])
# [
# {'conditions': {'client_filters': []},
# 'description': None,
# 'display_name': None,
# 'enabled': False,
# 'id': 'test_1',
# 'telemetry': {'metadata': {'ETag': 'hgRX_0yhNXOSl1vtyakBlTrNeEmL2GIBoxnnsw5gsmA'}}}
# ]
# Delete the "test_1" feature flag from Azure. After REFRESH_INTERVAL has elapsed, call refresh().
config.refresh() # after deleting the last flag 'test_1', state should become [], but stays stale
print(config["feature_management"]["feature_flags"])
# [
# {'conditions': {'client_filters': []},
# 'description': None,
# 'display_name': None,
# 'enabled': False,
# 'id': 'test_1',
# 'telemetry': {'metadata': {'ETag': 'hgRX_0yhNXOSl1vtyakBlTrNeEmL2GIBoxnnsw5gsmA'}}}
# ]
new_config = load_config()
print(new_config["feature_management"]["feature_flags"]) # []
Describe the bug
After the last feature flag matching the configured selector is deleted from Azure App Configuration,
AzureAppConfigurationProvider.refresh()keeps the old feature flag data in memory instead of updating the provider state to an empty list.To Reproduce
Steps to reproduce the behavior:
test_1in Azure.feature_flag_enabled=Trueandfeature_flag_refresh_enabled=True.test_1and callrefresh().config["feature_management"]["feature_flags"].load().Actual behavior
After deleting the last flag
test_1,refresh()still returns the staletest_1entry.A new
load()call correctly returns an empty feature flag list.Expected behavior
After the last matching feature flag is deleted,
refresh()should update the provider state to an empty feature flag list.Screenshots
Additional context