Skip to content

Commit 6e57f2e

Browse files
wip
1 parent 976a647 commit 6e57f2e

File tree

1 file changed

+45
-5
lines changed

1 file changed

+45
-5
lines changed

articles/azure-app-configuration/reference-javascript-provider.md

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const settings = await load(endpoint, credential, {
145145

146146
You can trim the prefix off of keys by providing a list of trimmed key prefixes to the `AzureAppConfigurationOptions.trimKeyPrefixes` property.
147147

148-
``` typescript
148+
```typescript
149149
const settings = await load(endpoint, credential, {
150150
selectors: [{
151151
keyFilter: "app.*"
@@ -154,13 +154,53 @@ const settings = await load(endpoint, credential, {
154154
});
155155
```
156156

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 dont 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+
```
158198

159199
## Dynamic refresh
160200

161201
### Watch sentinel key for refresh (Deprecated)
162202

163-
## Use feature flag
203+
## Feature flag
164204

165205
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.
166206

@@ -186,9 +226,9 @@ Feature management library provides a way to develop and expose application func
186226

187227
For more information about how to use JavaScript feature management library, please go to the [quickstart](./quickstart-feature-flag-javascript.md).
188228

189-
## Geo replication
229+
## Geo-replication
190230

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).
192232

193233
## Next steps
194234

0 commit comments

Comments
 (0)