@@ -145,7 +145,7 @@ const settings = await load(endpoint, credential, {
145
145
146
146
You can trim the prefix off of keys by providing a list of trimmed key prefixes to the ` AzureAppConfigurationOptions.trimKeyPrefixes ` property .
147
147
148
- ` ` ` typescript
148
+ ` ` ` typescript
149
149
const settings = await load(endpoint, credential, {
150
150
selectors: [{
151
151
keyFilter: "app.*"
@@ -154,13 +154,53 @@ const settings = await load(endpoint, credential, {
154
154
});
155
155
` ` `
156
156
157
- ## Use Key Vault reference
157
+ ## Key Vault reference
158
+
159
+ Azure App Configuration supports referencing secrets stored in Azure Key Vault . In App Configuration , keys can be created which have values that map to a secret stored in a Key Vault . The secrets are securely stored in Key Vault , but can be accessed the same as any other configuration once loaded .
160
+
161
+ The configuration provider library retrieves Key Vault references , just as it does for any other keys stored in App Configuration . Because the client recognizes the keys as Key Vault references , they have a unique content - type , and the client will connect to Key Vault to retrieve their values for your application . You need to configure ` AzureAppConfigurationOptions.KeyVaultOptions ` property with the propert credential to allow the configuration provider to connect to Azure Key Vault .
162
+
163
+ ` ` ` typescript
164
+ const credential = new DefaultAzureCredential();
165
+ const settings = await load(endpoint, credential, {
166
+ keyVaultOptions: {
167
+ credential: credential
168
+ }
169
+ });
170
+ ` ` `
171
+
172
+ You can also provide ` SecretClient ` instance directly to ` KeyVaultOptions ` . In this way , you can customize the options while creating ` SecretClient ` .
173
+
174
+ ` ` ` typescript
175
+ const { SecretClient } = require("@azure/keyvault-secrets");
176
+
177
+ const credential = new DefaultAzureCredential();
178
+ const secretClient = new SecretClient(keyVaultUrl, credential, {
179
+ serviceVersion: "7.0",
180
+ });
181
+ const settings = await load(endpoint, credential, {
182
+ keyVaultOptions: {
183
+ secretClients: [ secretClient ]
184
+ }
185
+ });
186
+ ` ` `
187
+
188
+ You can also set ` secretResolver ` property to locally resolve secrets that don ’t have a Key Vault associated with them .
189
+
190
+ ` ` ` typescript
191
+ const resolveSecret = (url) => "From Secret Resolver";
192
+ const settings = await load(endpoint, credential, {
193
+ keyVaultOptions: {
194
+ secretResolver: resolveSecret
195
+ }
196
+ });
197
+ ` ` `
158
198
159
199
## Dynamic refresh
160
200
161
201
### Watch sentinel key for refresh (Deprecated )
162
202
163
- ## Use feature flag
203
+ ## Feature flag
164
204
165
205
You can [create feature flags ](./ manage - feature - flags .md #create - a - feature - flag ) in the Azure App Configuration . By default , the feature flags will not be loaded by configuration provider . You can enable loading and refreshing feature flags through ` AzureAppConfigurationOptions.featureFlagOptions ` property when calling the ` load ` method .
166
206
@@ -186,9 +226,9 @@ Feature management library provides a way to develop and expose application func
186
226
187
227
For more information about how to use JavaScript feature management library , please go to the [quickstart ](./ quickstart - feature - flag - javascript .md ).
188
228
189
- ## Geo replication
229
+ ## Geo - replication
190
230
191
- For more information , please go to [Enable geo - replication ](./ howto - geo - replication .md ).
231
+ For information about use geo - replication , please go to [Enable geo - replication ](./ howto - geo - replication .md ).
192
232
193
233
## Next steps
194
234
0 commit comments