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
#Customer intent: As a JavaScript developer, I want to manage all my app settings in one place.
13
13
---
@@ -68,75 +68,91 @@ Add the following key-value to the App Configuration store and leave **Label** a
68
68
> [!NOTE]
69
69
> The code snippets in this example will help you get started with the App Configuration client library for JavaScript. For your application, you should also consider handling exceptions according to your needs. To learn more about exception handling, please refer to our [JavaScript SDK documentation](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appconfiguration/app-configuration).
70
70
71
-
## Configure your App Configuration connection string
71
+
## Configure an environment variable
72
72
73
-
1. Set an environment variable named **AZURE_APPCONFIG_CONNECTION_STRING**, and set it to the connection string of your App Configuration store. At the command line, run the following command:
73
+
### [Microsoft Entra ID (recommended)](#tab/entra-id)
To run the app locally using the Windows command prompt, run the following command and replace `<app-configuration-store-connection-string>` with the connection string of your app configuration store:
75
+
1. Set an environment variable named **AZURE_APPCONFIG_ENDPOINT** to the endpoint of your App Configuration store found under the **Overview** of your store in the Azure portal.
78
76
77
+
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
If you use Windows PowerShell, run the following command and replace `<app-configuration-store-connection-string>` with the connection string of your app configuration store:
If you use macOS, run the following command and replace `<app-configuration-store-connection-string>` with the connection string of your app configuration store:
If you use Linux, run the following command and replace `<app-configuration-store-connection-string>` with the connection string of your app configuration store:
Set an environment variable named **AZURE_APPCONFIG_CONNECTION_STRING** to the read-only connection string of your App Configuration store found under **Access keys** of your store in the Azure portal.
98
+
99
+
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
Using the Windows command prompt, restart the command prompt to allow the change to take effect and run the following command:
120
+
### [Microsoft Entra ID (recommended)](#tab/entra-id)
112
121
113
122
```cmd
114
-
echo %AZURE_APPCONFIG_CONNECTION_STRING%
123
+
echo AZURE_APPCONFIG_ENDPOINT
115
124
```
116
-
117
-
### [PowerShell](#tab/powershell)
118
-
119
-
If you use Windows PowerShell, run the following command:
120
-
121
-
```azurepowershell
122
-
$Env:AZURE_APPCONFIG_CONNECTION_STRING
125
+
126
+
If you use PowerShell, run the following command:
127
+
128
+
```powershell
129
+
$Env:AZURE_APPCONFIG_ENDPOINT
123
130
```
124
-
125
-
### [macOS](#tab/unix)
126
-
127
-
If you use macOS, run the following command:
128
-
129
-
```console
130
-
echo "$AZURE_APPCONFIG_CONNECTION_STRING"
131
+
132
+
If you use macOS or Linux, run the following command:
133
+
134
+
```bash
135
+
export AZURE_APPCONFIG_ENDPOINT
131
136
```
132
137
133
-
### [Linux](#tab/linux)
134
-
135
-
If you use Linux, run the following command:
138
+
### [Connection string](#tab/connection-string)
136
139
137
-
```console
138
-
echo "$AZURE_APPCONFIG_CONNECTION_STRING"
140
+
```cmd
141
+
echo AZURE_APPCONFIG_CONNECTION_STRING
142
+
```
143
+
144
+
If you use PowerShell, run the following command:
145
+
146
+
```powershell
147
+
$Env:AZURE_APPCONFIG_CONNECTION_STRING
139
148
```
149
+
150
+
If you use macOS or Linux, run the following command:
151
+
152
+
```bash
153
+
export AZURE_APPCONFIG_CONNECTION_STRING
154
+
```
155
+
---
140
156
141
157
## Code samples
142
158
@@ -158,12 +174,31 @@ Learn below how to:
158
174
159
175
### Connect to an App Configuration store
160
176
161
-
The following code snippet creates an instance of **AppConfigurationClient** using the connection string stored in your environment variables.
177
+
The following code snippet creates an instance of **AppConfigurationClient**. You can connect to your App Configuration store using Microsoft Entra ID (recommended), or a connection string.
178
+
179
+
### [Microsoft Entra ID (recommended)](#tab/entra-id)
180
+
181
+
You use the `DefaultAzureCredential` to authenticate to your App Configuration store. Follow the [instructions](./concept-enable-rbac.md#authentication-with-token-credentials) to assign your credential the **App Configuration Data Reader** role. Be sure to allow sufficient time for the permission to propagate before running your application.
0 commit comments