Skip to content

Commit 85c0175

Browse files
Update README for examples (#41)
* update readme * add colon
1 parent 0adf2ff commit 85c0175

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

examples/README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,37 @@ Samples retrieve credentials to access your App Configuration store from environ
1414
Alternatively, edit the source code to include the appropriate credentials.
1515
See each individual sample for details on which environment variables/credentials it requires to function.
1616

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

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:
2027

2128
1. Install the dependencies using `npm`:
2229

2330
```bash
2431
npm install
2532
```
2633

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 example programs will read this file automatically.
2837

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.
39+
```bash
40+
npx cross-env APPCONFIG_CONNECTION_STRING="<appconfig connection string>"
41+
```
42+
43+
3. Run the example:
3144
```bash
3245
node helloworld.mjs
3346
```
34-
35-
- 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):
36-
```bash
37-
npx cross-env APPCONFIG_CONNECTION_STRING="<appconfig connection string>" node helloworld.mjs
47+
You should see the following output:
48+
```Output
49+
Message from Azure App Configuration: Hello World!
3850
```

0 commit comments

Comments
 (0)