You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Samples retrieve credentials to access your App Configuration store from environment variables.
13
+
The examples retrieve credentials to access your App Configuration store from environment variables.
14
14
Alternatively, edit the source code to include the appropriate credentials.
15
-
See each individual sample for details on which environment variables/credentials it requires to function.
15
+
See each individual example for details on which environment variables/credentials it requires to function.
16
16
17
-
## Setup
17
+
## Add a key-value
18
+
Add the following key-value to the App Configuration store and leave **Label** and **Content Type** with their default values. For more information about how to add key-values to a store using the Azure portal or the CLI, go to [Create a key-value](./quickstart-azure-app-configuration-create.md#create-a-key-value).
18
19
19
-
To run the samples using the published version of the package:
20
+
| Key | Value |
21
+
|------------------------|----------------|
22
+
|*app.settings.message*|*Hello World!*|
23
+
24
+
## Setup & Run
25
+
26
+
To run the examples using the published version of the package:
20
27
21
28
1. Install the dependencies using `npm`:
22
29
23
30
```bash
24
31
npm install
25
32
```
26
33
27
-
2. There are two ways to run the samples using correct credentials:
34
+
2. There are two ways to run the examples using correct credentials:
35
+
36
+
- Edit the file `.env.template`, adding the access keys to your App Configuration store. and rename the file from `.env.template` to just `.env`. The examples will read this file automatically.
28
37
29
-
- Edit the file `.env.template`, adding the correct credentials to access your Azure App Configuration store and rename the file from `.env.template` to just `.env`.
30
-
Then run the samples, it will read this file automatically.
38
+
- Alternatively, you can set the environment variables to the access keys to your App Configuration store. In this case, setting up the `.env` file is not required.
- Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
* This example demonstrates how to construct a configuration object from settings loaded from Azure App Configuration.
9
+
* If you are using configuration object instead of Map-styled settings, it would minimize the code changes required to use Azure App Configuration in your application.
10
+
*
11
+
* When you import configuration into Azure App Configuration from a local .json file, the keys are automatically flattened with a separator if specified.
12
+
* E.g. if you import the following .json file, specifying the separator as ".":
13
+
* {
14
+
* "app": {
15
+
* "settings": {
16
+
* "message": "Hello, Azure!"
17
+
* }
18
+
* }
19
+
* }
20
+
*
21
+
* In the configuration explorer, the key-values will be:
refreshIntervalInMs: 10*1000// Default value is 30 seconds, shorted for this sample
29
+
}
30
+
});
31
+
32
+
console.log("Using Azure portal or CLI, update the `app.settings.message` value, and then update the `app.settings.sentinel` value in your App Configuration store.")
0 commit comments