Skip to content

Commit 87d281b

Browse files
authored
Merge pull request #292039 from MicrosoftDocs/main
12/17 11:00 AM IST Publish
2 parents 126a5a2 + 2b2b74b commit 87d281b

File tree

71 files changed

+387
-305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+387
-305
lines changed

articles/azure-app-configuration/enable-dynamic-configuration-aspnet-netfx.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ Add the following key-values to the App Configuration store and leave **Label**
164164

165165
If you use the Windows command prompt, run the following command:
166166
```console
167-
setx ConnectionString "connection-string-of-your-app-configuration-store"
167+
setx ConnectionString "<connection-string-of-your-app-configuration-store>"
168168
```
169169

170170
If you use Windows PowerShell, run the following command:
171171
```powershell
172-
$Env:ConnectionString = "connection-string-of-your-app-configuration-store"
172+
$Env:ConnectionString = "<connection-string-of-your-app-configuration-store>"
173173
```
174174

175175
1. Restart Visual Studio to allow the change to take effect.

articles/azure-app-configuration/enable-dynamic-configuration-azure-functions-csharp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,19 @@ Azure Functions support running [in-process](../azure-functions/functions-dotnet
184184
1. Set an environment variable named **ConnectionString**, and set it to the access key to your app configuration store. If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
185185

186186
```console
187-
setx ConnectionString "connection-string-of-your-app-configuration-store"
187+
setx ConnectionString "<connection-string-of-your-app-configuration-store>"
188188
```
189189

190190
If you use Windows PowerShell, run the following command:
191191

192192
```powershell
193-
$Env:ConnectionString = "connection-string-of-your-app-configuration-store"
193+
$Env:ConnectionString = "<connection-string-of-your-app-configuration-store>"
194194
```
195195

196196
If you use macOS or Linux, run the following command:
197197

198198
```console
199-
export ConnectionString='connection-string-of-your-app-configuration-store'
199+
export ConnectionString='<connection-string-of-your-app-configuration-store>'
200200
```
201201

202202
2. To test your function, press F5. If prompted, accept the request from Visual Studio to download and install **Azure Functions Core (CLI)** tools. You might also need to enable a firewall exception so that the tools can handle HTTP requests.

articles/azure-app-configuration/enable-dynamic-configuration-dotnet-background-service.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,19 +177,19 @@ You use the [.NET command-line interface (CLI)](/dotnet/core/tools/) to create a
177177
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
178178
179179
```cmd
180-
setx Endpoint "endpoint-of-your-app-configuration-store"
180+
setx Endpoint "<endpoint-of-your-app-configuration-store>"
181181
```
182182
183183
If you use PowerShell, run the following command:
184184
185185
```powershell
186-
$Env:Endpoint = "endpoint-of-your-app-configuration-store"
186+
$Env:Endpoint = "<endpoint-of-your-app-configuration-store>"
187187
```
188188
189189
If you use macOS or Linux, run the following command:
190190
191191
```bash
192-
export Endpoint='endpoint-of-your-app-configuration-store'
192+
export Endpoint='<endpoint-of-your-app-configuration-store>'
193193
```
194194
195195
### [Connection string](#tab/connection-string)
@@ -198,19 +198,19 @@ You use the [.NET command-line interface (CLI)](/dotnet/core/tools/) to create a
198198
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
199199
200200
```cmd
201-
setx ConnectionString "connection-string-of-your-app-configuration-store"
201+
setx ConnectionString "<connection-string-of-your-app-configuration-store>"
202202
```
203203
204204
If you use PowerShell, run the following command:
205205
206206
```powershell
207-
$Env:ConnectionString = "connection-string-of-your-app-configuration-store"
207+
$Env:ConnectionString = "<connection-string-of-your-app-configuration-store>"
208208
```
209209
210210
If you use macOS or Linux, run the following command:
211211
212212
```bash
213-
export ConnectionString='connection-string-of-your-app-configuration-store'
213+
export ConnectionString='<connection-string-of-your-app-configuration-store>'
214214
```
215215
---
216216

articles/azure-app-configuration/enable-dynamic-configuration-dotnet-core-push-refresh.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,31 +185,31 @@ The `ProcessPushNotification` method takes in a `PushNotification` object contai
185185
To build and run the app locally using the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
186186

187187
```console
188-
setx AppConfigurationConnectionString "connection-string-of-your-app-configuration-store"
188+
setx AppConfigurationConnectionString "<connection-string-of-your-app-configuration-store>"
189189
```
190190

191191
### [PowerShell](#tab/powershell)
192192

193193
If you use Windows PowerShell, run the following command:
194194

195195
```powershell
196-
$Env:AppConfigurationConnectionString = "connection-string-of-your-app-configuration-store"
196+
$Env:AppConfigurationConnectionString = "<connection-string-of-your-app-configuration-store>"
197197
```
198198

199199
### [macOS](#tab/unix)
200200

201201
If you use macOS, run the following command:
202202

203203
```console
204-
export AppConfigurationConnectionString='connection-string-of-your-app-configuration-store'
204+
export AppConfigurationConnectionString='<connection-string-of-your-app-configuration-store>'
205205
```
206206

207207
### [Linux](#tab/linux)
208208

209209
If you use Linux, run the following command:
210210

211211
```console
212-
export AppConfigurationConnectionString='connection-string-of-your-app-configuration-store'
212+
export AppConfigurationConnectionString='<connection-string-of-your-app-configuration-store>'
213213
```
214214

215215
---

articles/azure-app-configuration/enable-dynamic-configuration-dotnet-core.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,19 @@ In the previous code, you're manually saving an instance of `IConfigurationRefre
117117
1. Set an environment variable named **ConnectionString**, and set it to the access key to your App Configuration store. If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
118118

119119
```console
120-
setx ConnectionString "connection-string-of-your-app-configuration-store"
120+
setx ConnectionString "<connection-string-of-your-app-configuration-store>"
121121
```
122122

123123
If you use Windows PowerShell, run the following command:
124124

125125
```powershell
126-
$Env:ConnectionString = "connection-string-of-your-app-configuration-store"
126+
$Env:ConnectionString = "<connection-string-of-your-app-configuration-store>"
127127
```
128128

129129
If you use macOS or Linux, run the following command:
130130

131131
```console
132-
export ConnectionString='connection-string-of-your-app-configuration-store'
132+
export ConnectionString='<connection-string-of-your-app-configuration-store>'
133133
```
134134

135135
1. Run the following command to build the console app:

articles/azure-app-configuration/enable-dynamic-configuration-dotnet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ Add the following key-value to the App Configuration store and leave **Label** a
114114

115115
If you use the Windows command prompt, run the following command:
116116
```console
117-
setx ConnectionString "connection-string-of-your-app-configuration-store"
117+
setx ConnectionString "<connection-string-of-your-app-configuration-store>"
118118
```
119119

120120
If you use Windows PowerShell, run the following command:
121121
```powershell
122-
$Env:ConnectionString = "connection-string-of-your-app-configuration-store"
122+
$Env:ConnectionString = "<connection-string-of-your-app-configuration-store>"
123123
```
124124

125125
1. Restart Visual Studio to allow the change to take effect.

articles/azure-app-configuration/enable-dynamic-configuration-java-spring-push-refresh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Event Grid Web Hooks require validation on creation. You can validate by followi
161161
If you use macOS or Linux, run the following command:
162162

163163
```bash
164-
export APP_CONFIGURATION_ENDPOINT='endpoint-of-your-app-configuration-store'
164+
export APP_CONFIGURATION_ENDPOINT='<endpoint-of-your-app-configuration-store>'
165165
```
166166

167167
### [Connection string](#tab/connection-string)
@@ -182,7 +182,7 @@ Event Grid Web Hooks require validation on creation. You can validate by followi
182182
If you use macOS or Linux, run the following command:
183183

184184
```bash
185-
export APP_CONFIGURATION_CONNECTION_STRING='connection-string-of-your-app-configuration-store'
185+
export APP_CONFIGURATION_CONNECTION_STRING='<connection-string-of-your-app-configuration-store>'
186186
```
187187
---
188188

articles/azure-app-configuration/enable-dynamic-configuration-javascript.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: Use dynamic configuration in JavaScript
33
titleSuffix: Azure App Configuration
44
description: Learn how to dynamically update configuration data for JavaScript.
55
services: azure-app-configuration
6-
author: eskibear
6+
author: zhiyuanliang-ms
77
ms.service: azure-app-configuration
88
ms.devlang: javascript
99
ms.topic: tutorial
1010
ms.date: 03/27/2024
1111
ms.custom: devx-track-js
12-
ms.author: yanzh
12+
ms.author: zhiyuanliang
1313
#Customer intent: As a JavaScript developer, I want to dynamically update my app to use the latest configuration data in Azure App Configuration.
1414
---
1515
# Tutorial: Use dynamic configuration in JavaScript
@@ -39,13 +39,15 @@ Add the following key-value to your Azure App Configuration store. For more info
3939
The following examples show how to use refreshable configuration values in console applications.
4040
Choose the following instructions based on how your application consumes configuration data loaded from App Configuration, either as a `Map` or a configuration object.
4141

42+
You can connect to App Configuration using either Microsoft Entra ID (recommended) or a connection string. The following code snippet demonstrates using Microsoft Entra ID. You use the DefaultAzureCredential to authenticate to your App Configuration store. While completing the quickstart listed in the prerequisites, you already [assigned your credential the App Configuration Data Reader role](./concept-enable-rbac.md#authentication-with-token-credentials).
43+
4244
1. Open the file *app.js* and update the `load` function. Add a `refreshOptions` parameter to enable the refresh and configure refresh options. The loaded configuration will be updated when a change is detected on the server. By default, a refresh interval of 30 seconds is used, but you can override it with the `refreshIntervalInMs` property.
4345

4446
### [Use configuration as Map](#tab/configuration-map)
4547

4648
```javascript
47-
// Connecting to Azure App Configuration using connection string
48-
const settings = await load(connectionString, {
49+
// Connecting to Azure App Configuration using endpoint and token credential
50+
const settings = await load(endpoint, credential, {
4951
// Setting up to refresh when the sentinel key is changed
5052
refreshOptions: {
5153
enabled: true,
@@ -60,8 +62,8 @@ Choose the following instructions based on how your application consumes configu
6062
To ensure an up-to-date configuration, update the configuration object in the `onRefresh` callback triggered whenever a configuration change is detected and the configuration is updated.
6163

6264
```javascript
63-
// Connecting to Azure App Configuration using connection string
64-
const settings = await load(connectionString, {
65+
// Connecting to Azure App Configuration using endpoint and token credential
66+
const settings = await load(endpoint, credential, {
6567
// Setting up to refresh when the sentinel key is changed
6668
refreshOptions: {
6769
enabled: true,
@@ -115,11 +117,13 @@ Choose the following instructions based on how your application consumes configu
115117
```javascript
116118
const sleepInMs = require("util").promisify(setTimeout);
117119
const { load } = require("@azure/app-configuration-provider");
118-
const connectionString = process.env.AZURE_APPCONFIG_CONNECTION_STRING;
120+
const { DefaultAzureCredential } = require("@azure/identity");
121+
const endpoint = process.env.AZURE_APPCONFIG_ENDPOINT;
122+
const credential = new DefaultAzureCredential(); // For more information, see https://learn.microsoft.com/azure/developer/javascript/sdk/credential-chains#use-defaultazurecredential-for-flexibility
119123
120124
async function run() {
121-
// Connecting to Azure App Configuration using connection string
122-
const settings = await load(connectionString, {
125+
// Connecting to Azure App Configuration using endpoint and token credential
126+
const settings = await load(endpoint, credential, {
123127
// Setting up to refresh when the sentinel key is changed
124128
refreshOptions: {
125129
enabled: true,
@@ -142,11 +146,13 @@ Choose the following instructions based on how your application consumes configu
142146
```javascript
143147
const sleepInMs = require("util").promisify(setTimeout);
144148
const { load } = require("@azure/app-configuration-provider");
145-
const connectionString = process.env.AZURE_APPCONFIG_CONNECTION_STRING;
149+
const { DefaultAzureCredential } = require("@azure/identity");
150+
const endpoint = process.env.AZURE_APPCONFIG_ENDPOINT;
151+
const credential = new DefaultAzureCredential(); // For more information, see https://learn.microsoft.com/azure/developer/javascript/sdk/credential-chains#use-defaultazurecredential-for-flexibility
146152
147153
async function run() {
148-
// Connecting to Azure App Configuration using connection string
149-
const settings = await load(connectionString, {
154+
// Connecting to Azure App Configuration using endpoint and token credential
155+
const settings = await load(endpoint, credential, {
150156
// Setting up to refresh when the sentinel key is changed
151157
refreshOptions: {
152158
enabled: true,

articles/azure-app-configuration/integrate-ci-cd-pipeline.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,31 +70,31 @@ If you build locally, download and install the [Azure CLI](/cli/azure/install-az
7070
To build and run the app locally using the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
7171

7272
```console
73-
setx ConnectionString "connection-string-of-your-app-configuration-store"
73+
setx ConnectionString "<connection-string-of-your-app-configuration-store>"
7474
```
7575

7676
### [PowerShell](#tab/powershell)
7777

7878
If you use Windows PowerShell, run the following command:
7979

8080
```powershell
81-
$Env:ConnectionString = "connection-string-of-your-app-configuration-store"
81+
$Env:ConnectionString = "<connection-string-of-your-app-configuration-store>"
8282
```
8383

8484
### [macOS](#tab/unix)
8585

8686
If you use macOS, run the following command:
8787

8888
```console
89-
export ConnectionString='connection-string-of-your-app-configuration-store'
89+
export ConnectionString='<connection-string-of-your-app-configuration-store>'
9090
```
9191

9292
### [Linux](#tab/linux)
9393

9494
If you use Linux, run the following command:
9595

9696
```console
97-
export ConnectionString='connection-string-of-your-app-configuration-store'
97+
export ConnectionString='<connection-string-of-your-app-configuration-store>'
9898
```
9999

100100
---

articles/azure-app-configuration/quickstart-azure-functions-csharp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,19 +183,19 @@ This project will use [dependency injection in .NET Azure Functions](../azure-fu
183183
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
184184

185185
```cmd
186-
setx ConnectionString "connection-string-of-your-app-configuration-store"
186+
setx ConnectionString "<connection-string-of-your-app-configuration-store>"
187187
```
188188

189189
If you use PowerShell, run the following command:
190190

191191
```powershell
192-
$Env:ConnectionString = "connection-string-of-your-app-configuration-store"
192+
$Env:ConnectionString = "<connection-string-of-your-app-configuration-store>"
193193
```
194194

195195
If you use macOS or Linux, run the following command:
196196

197197
```bash
198-
export ConnectionString='connection-string-of-your-app-configuration-store'
198+
export ConnectionString='<connection-string-of-your-app-configuration-store>'
199199
```
200200

201201
2. Press F5 to test your function. If prompted, accept the request from Visual Studio to download and install **Azure Functions Core (CLI)** tools. You might also need to enable a firewall exception so that the tools can handle HTTP requests.

0 commit comments

Comments
 (0)