Skip to content

Commit 07a5f4f

Browse files
committed
Updates from review
1 parent 8f16b38 commit 07a5f4f

File tree

3 files changed

+73
-46
lines changed

3 files changed

+73
-46
lines changed

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ Add the following key-values to the App Configuration store and leave **Label**
9999
builder.AddAzureAppConfiguration(options =>
100100
{
101101
string endpoint = Environment.GetEnvironmentVariable("Endpoint");
102-
options.Connect(new Uri(endpoint), new DefaultAzureCredential());
103-
// Load all keys that start with `TestApp:` and have no label.
104-
.Select("TestApp:*")
105-
// Configure to reload configuration if the registered key 'TestApp:Settings:Sentinel' is modified.
106-
.ConfigureRefresh(refresh =>
107-
{
108-
refresh.Register("TestApp:Settings:Sentinel", refreshAll:true)
109-
.SetCacheExpiration(new TimeSpan(0, 5, 0));
110-
});
102+
options.Connect(new Uri(endpoint), new DefaultAzureCredential())
103+
// Load all keys that start with `TestApp:` and have no label.
104+
.Select("TestApp:*")
105+
// Configure to reload configuration if the registered key 'TestApp:Settings:Sentinel' is modified.
106+
.ConfigureRefresh(refresh =>
107+
{
108+
refresh.Register("TestApp:Settings:Sentinel", refreshAll:true)
109+
.SetCacheExpiration(new TimeSpan(0, 5, 0));
110+
});
111111
_configurationRefresher = options.GetRefresher();
112112
});
113113

@@ -124,14 +124,14 @@ Add the following key-values to the App Configuration store and leave **Label**
124124
builder.AddAzureAppConfiguration(options =>
125125
{
126126
options.Connect(Environment.GetEnvironmentVariable("ConnectionString"))
127-
// Load all keys that start with `TestApp:` and have no label.
128-
.Select("TestApp:*")
129-
// Configure to reload configuration if the registered key 'TestApp:Settings:Sentinel' is modified.
130-
.ConfigureRefresh(refresh =>
131-
{
132-
refresh.Register("TestApp:Settings:Sentinel", refreshAll:true)
133-
.SetCacheExpiration(new TimeSpan(0, 5, 0));
134-
});
127+
// Load all keys that start with `TestApp:` and have no label.
128+
.Select("TestApp:*")
129+
// Configure to reload configuration if the registered key 'TestApp:Settings:Sentinel' is modified.
130+
.ConfigureRefresh(refresh =>
131+
{
132+
refresh.Register("TestApp:Settings:Sentinel", refreshAll:true)
133+
.SetCacheExpiration(new TimeSpan(0, 5, 0));
134+
});
135135
_configurationRefresher = options.GetRefresher();
136136
});
137137

@@ -236,7 +236,7 @@ Add the following key-values to the App Configuration store and leave **Label**
236236

237237
### [Connection string](#tab/connection-string)
238238

239-
Set an environment variable named `ConnectionString` to the read-only key connection string found under **Access keys** of your store in the Azure portal.
239+
Set an environment variable named `ConnectionString` to the read-only key connection string found under **Access settings** of your store in the Azure portal.
240240

241241
If you use the Windows command prompt, run the following command:
242242
```console

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

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ var builder = new ConfigurationBuilder();
4949
builder.AddAzureAppConfiguration(options =>
5050
{
5151
string endpoint = Environment.GetEnvironmentVariable("Endpoint");
52-
options.Connect(new Uri(endpoint), new DefaultAzureCredential());
53-
.ConfigureRefresh(refresh =>
54-
{
55-
refresh.Register("TestApp:Settings:Message")
56-
.SetCacheExpiration(TimeSpan.FromSeconds(10));
57-
});
52+
options.Connect(new Uri(endpoint), new DefaultAzureCredential())
53+
.ConfigureRefresh(refresh =>
54+
{
55+
refresh.Register("TestApp:Settings:Message")
56+
.SetCacheExpiration(TimeSpan.FromSeconds(10));
57+
});
5858

5959
_refresher = options.GetRefresher();
6060
});
@@ -118,7 +118,12 @@ In the previous code, you're manually saving an instance of `IConfigurationRefre
118118

119119
## Build and run the app locally
120120

121-
1. Set an environment variable named **Endpoint**, 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:
121+
## Build and run the app locally
122+
123+
1. Set an environment variable.
124+
125+
### [Microsoft Entra ID (recommended)](#tab/entra-id)
126+
Set the environment variable named **Endpoint** to the endpoint of your App Configuration store found under the *Overview* of your store in the Azure portal.
122127

123128
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
124129

@@ -138,6 +143,28 @@ In the previous code, you're manually saving an instance of `IConfigurationRefre
138143
export Endpoint='<endpoint-of-your-app-configuration-store>'
139144
```
140145

146+
### [Connection string](#tab/connection-string)
147+
Set the environment variable named **ConnectionString** to the read-only connection string of your App Configuration store found under **Access settings** of your store in the Azure portal.
148+
149+
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
150+
151+
```cmd
152+
setx ConnectionString "<connection-string-of-your-app-configuration-store>"
153+
```
154+
155+
If you use PowerShell, run the following command:
156+
157+
```powershell
158+
$Env:ConnectionString = "<connection-string-of-your-app-configuration-store>"
159+
```
160+
161+
If you use macOS or Linux, run the following command:
162+
163+
```bash
164+
export ConnectionString='<connection-string-of-your-app-configuration-store>'
165+
```
166+
---
167+
141168
1. Run the following command to build the console app:
142169

143170
```console

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

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

5151
### [Microsoft Entra ID (recommended)](#tab/entra-id)
5252

53-
*Microsoft.Extensions.Configuration.AzureAppConfiguration*
54-
*Azure.Identity*
53+
- *Microsoft.Extensions.Configuration.AzureAppConfiguration*
54+
- *Azure.Identity*
5555

5656
### [Connection string](#tab/connection-string)
5757

58-
*Microsoft.Extensions.Configuration.AzureAppConfiguration*
58+
- *Microsoft.Extensions.Configuration.AzureAppConfiguration*
5959
---
6060

6161
1. Open *Program.cs* and add following namespaces.
@@ -99,16 +99,16 @@ Add the following key-value to the App Configuration store and leave **Label** a
9999
var builder = new ConfigurationBuilder();
100100
builder.AddAzureAppConfiguration(options =>
101101
{
102-
string endpoint = Environment.GetEnvironmentVariable("Endpoint");
103-
options.Connect(new Uri(endpoint), new DefaultAzureCredential());
104-
// Load all keys that start with `TestApp:`.
105-
.Select("TestApp:*")
106-
// Configure to reload the key 'TestApp:Settings:Message' if it is modified.
107-
.ConfigureRefresh(refresh =>
108-
{
109-
refresh.Register("TestApp:Settings:Message")
110-
.SetCacheExpiration(TimeSpan.FromSeconds(10));
111-
});
102+
string endpoint = Environment.GetEnvironmentVariable("Endpoint");
103+
options.Connect(new Uri(endpoint), new DefaultAzureCredential())
104+
// Load all keys that start with `TestApp:`.
105+
.Select("TestApp:*")
106+
// Configure to reload the key 'TestApp:Settings:Message' if it is modified.
107+
.ConfigureRefresh(refresh =>
108+
{
109+
refresh.Register("TestApp:Settings:Message")
110+
.SetCacheExpiration(TimeSpan.FromSeconds(10));
111+
});
112112

113113
_refresher = options.GetRefresher();
114114
});
@@ -133,14 +133,14 @@ Add the following key-value to the App Configuration store and leave **Label** a
133133
builder.AddAzureAppConfiguration(options =>
134134
{
135135
options.Connect(Environment.GetEnvironmentVariable("ConnectionString"))
136-
// Load all keys that start with `TestApp:`.
137-
.Select("TestApp:*")
138-
// Configure to reload the key 'TestApp:Settings:Message' if it is modified.
139-
.ConfigureRefresh(refresh =>
140-
{
141-
refresh.Register("TestApp:Settings:Message")
142-
.SetCacheExpiration(TimeSpan.FromSeconds(10));
143-
});
136+
// Load all keys that start with `TestApp:`.
137+
.Select("TestApp:*")
138+
// Configure to reload the key 'TestApp:Settings:Message' if it is modified.
139+
.ConfigureRefresh(refresh =>
140+
{
141+
refresh.Register("TestApp:Settings:Message")
142+
.SetCacheExpiration(TimeSpan.FromSeconds(10));
143+
});
144144

145145
_refresher = options.GetRefresher();
146146
});

0 commit comments

Comments
 (0)