@@ -64,16 +64,15 @@ The Python App Configuration provider is a library in preview running on top of
64
64
65
65
```python
66
66
from azure.appconfiguration.provider import (
67
- AzureAppConfigurationProvider ,
67
+ load_provider ,
68
68
SettingSelector
69
69
)
70
70
import os
71
71
72
72
connection_string = os.environ.get("AZURE_APPCONFIG_CONNECTION_STRING")
73
73
74
74
# Connect to Azure App Configuration using a connection string.
75
- config = AzureAppConfigurationProvider.load(
76
- connection_string=connection_string)
75
+ config = load_provider(connection_string=connection_string)
77
76
78
77
# Find the key "message" and print its value.
79
78
print(config["message"])
@@ -82,15 +81,13 @@ The Python App Configuration provider is a library in preview running on top of
82
81
83
82
# Connect to Azure App Configuration using a connection string and trimmed key prefixes.
84
83
trimmed = {"test."}
85
- config = AzureAppConfigurationProvider.load(
86
- connection_string=connection_string, trimmed_key_prefixes=trimmed)
84
+ config = load_provider(connection_string=connection_string, trim_prefixes=trimmed)
87
85
# From the keys with trimmed prefixes, find a key with "message" and print its value.
88
86
print(config["message"])
89
87
90
88
# Connect to Azure App Configuration using SettingSelector.
91
- selects = {SettingSelector("message*", "\0")}
92
- config = AzureAppConfigurationProvider.load(
93
- connection_string=connection_string, selects=selects)
89
+ selects = {SettingSelector(key_filter="message*", label_filter="\0")}
90
+ config = load_provider(connection_string=connection_string, selects=selects)
94
91
95
92
# Print True or False to indicate if "message" is found in Azure App Configuration.
96
93
print("message found: " + str("message" in config))
0 commit comments