Skip to content

Commit f686468

Browse files
committed
Update tab format
1 parent 77244d9 commit f686468

File tree

1 file changed

+16
-30
lines changed

1 file changed

+16
-30
lines changed

articles/azure-app-configuration/quickstart-dotnet-app.md

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -55,65 +55,52 @@ Connect to your App Configuration store using Microsoft Entra ID (recommended),
5555

5656
1. Update the *App.config* file of your project as follows. You can connect to your App Configuration store using Microsoft Entra ID (recommended), or a connection string.
5757

58-
### [Microsoft Entra ID (recommended)](#tab/entra-id)
59-
60-
The `DefaultAzureCredential` is used to authenticate to your App Configuration store by default. 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.
61-
58+
### [Microsoft Entra ID (recommended)](#tab/entra-id)
59+
60+
The `DefaultAzureCredential` is used to authenticate to your App Configuration store by default. 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.
61+
6262
```xml
6363
<configSections>
6464
<section name="configBuilders" type="System.Configuration.ConfigurationBuildersSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="false" requirePermission="false" />
6565
</configSections>
66-
66+
6767
<configBuilders>
6868
<builders>
6969
<add name="MyConfigStore" mode="Greedy" endpoint="${Endpoint}" type="Microsoft.Configuration.ConfigurationBuilders.AzureAppConfigurationBuilder, Microsoft.Configuration.ConfigurationBuilders.AzureAppConfiguration" />
7070
<add name="Environment" mode="Greedy" type="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Environment" />
7171
</builders>
7272
</configBuilders>
73-
73+
7474
<appSettings configBuilders="Environment,MyConfigStore">
7575
<add key="AppName" value="Console App Demo" />
7676
<add key="Endpoint" value ="Set via an environment variable - for example, dev, test, staging, or production endpoint." />
7777
</appSettings>
7878
```
79-
80-
The endpoint value of your App Configuration store is read from the environment variable `Endpoint`. You also add the `Environment` configuration builder before the `MyConfigStore` in the `configBuilders` property of the `appSettings` section.
81-
82-
1. Open *Program.cs*, and update the `Main` method to use App Configuration by calling `ConfigurationManager`.
83-
84-
```csharp
85-
static void Main(string[] args)
86-
{
87-
string message = System.Configuration.ConfigurationManager.AppSettings["TestApp:Settings:Message"];
88-
89-
Console.WriteLine(message);
90-
Console.ReadKey();
91-
}
92-
```
93-
94-
### [Connection string](#tab/connection-string)
95-
96-
1. Update the *App.config* file of your project as follows:
97-
79+
80+
The endpoint value of your App Configuration store is read from the environment variable `Endpoint`. You also add the `Environment` configuration builder before the `MyConfigStore` in the `configBuilders` property of the `appSettings` section.
81+
82+
### [Connection string](#tab/connection-string)
83+
9884
```xml
9985
<configSections>
10086
<section name="configBuilders" type="System.Configuration.ConfigurationBuildersSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="false" requirePermission="false" />
10187
</configSections>
102-
88+
10389
<configBuilders>
10490
<builders>
10591
<add name="MyConfigStore" mode="Greedy" connectionString="${ConnectionString}" type="Microsoft.Configuration.ConfigurationBuilders.AzureAppConfigurationBuilder, Microsoft.Configuration.ConfigurationBuilders.AzureAppConfiguration" />
10692
<add name="Environment" mode="Greedy" type="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Environment" />
10793
</builders>
10894
</configBuilders>
109-
95+
11096
<appSettings configBuilders="Environment,MyConfigStore">
11197
<add key="AppName" value="Console App Demo" />
11298
<add key="ConnectionString" value ="Set via an environment variable - for example, dev, test, staging, or production connection string." />
11399
</appSettings>
114100
```
115-
116-
The connection string of your App Configuration store is read from the environment variable `ConnectionString`. You also add the `Environment` configuration builder before the `MyConfigStore` in the `configBuilders` property of the `appSettings` section.
101+
102+
The connection string of your App Configuration store is read from the environment variable `ConnectionString`. You also add the `Environment` configuration builder before the `MyConfigStore` in the `configBuilders` property of the `appSettings` section.
103+
---
117104

118105
1. Open *Program.cs*, and update the `Main` method to use App Configuration by calling `ConfigurationManager`.
119106

@@ -126,7 +113,6 @@ The `DefaultAzureCredential` is used to authenticate to your App Configuration s
126113
Console.ReadKey();
127114
}
128115
```
129-
---
130116

131117
## Build and run the app
132118

0 commit comments

Comments
 (0)