Skip to content

Commit 7fe361a

Browse files
committed
Merging sections, envs
1 parent 01b4f38 commit 7fe361a

File tree

1 file changed

+11
-35
lines changed

1 file changed

+11
-35
lines changed

articles/azure-app-configuration/howto-geo-replication.md

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ When geo-replication is enabled, and if one replica isn't accessible, you can le
9292

9393
Assuming you have an application using Azure App Configuration, you can update it as the following sample code to take advantage of the failover feature. You can either provide a list of endpoints for AAD authentication or a list of connection strings for access key-based authentication.
9494

95-
### With AAD
96-
9795
#### [.NET](#tab/dotnet)
9896

9997
Edit the call to the `AddAzureAppConfiguration` method, which is often found in the `program.cs` file of your application.
@@ -111,41 +109,14 @@ configurationBuilder.AddAzureAppConfiguration(options =>
111109

112110
// Other changes to options
113111
});
114-
```
115-
116-
> [!NOTE]
117-
> The failover support is available if you use version **6.0.0** or later of any of the following packages.
118-
> - `Microsoft.Extensions.Configuration.AzureAppConfiguration`
119-
> - `Microsoft.Azure.AppConfiguration.AspNetCore`
120-
> - `Microsoft.Azure.AppConfiguration.Functions.Worker`
121-
122-
#### [Java Spring](#tab/spring)
123-
124-
Edit the endpoint configuration in `bootstrap.properties`, to use endpoints which allows a list of endpoints.
125-
126-
```properties
127-
spring.cloud.azure.appconfiguration.stores[0].endpoints[0]="<first-replica-endpoint>"
128-
spring.cloud.azure.appconfiguration.stores[0].endpoints[1]="<second-replica-endpoint>"
129-
```
130-
> [!NOTE]
131-
> The failover support is available if you use version of **4.7.0** or later of any of the following packages.
132-
> - `spring-cloud-azure-appconfiguration-config`
133-
> - `spring-cloud-azure-appconfiguration-config-web`
134-
> - `spring-cloud-azure-starter-appconfiguration-config`
135-
136-
---
137-
138-
### With Access Keys
139-
140-
#### [.NET](#tab/dotnet)
141112

142-
Edit the call to the `AddAzureAppConfiguration` method, which is often found in the `program.cs` file of your application.
143-
144-
```csharp
145113
configurationBuilder.AddAzureAppConfiguration(options =>
146114
{
147115
// Provide an ordered list of replica connection strings
148-
var connectionStrings = new List<string> { "first-replica-connection-string", "second-replica-connection-string"};
116+
var connectionStrings = new string[] {
117+
Environment.GetEnvironmentVariable("FIRST_REPLICA_CONNECTION_STRING"),
118+
Environment.GetEnvironmentVariable("SECOND_REPLICA_CONNECTION_STRING") };
119+
149120

150121
// Connect to replica endpoints using connection strings
151122
options.Connect(connectionStrings);
@@ -162,13 +133,18 @@ configurationBuilder.AddAzureAppConfiguration(options =>
162133
163134
#### [Java Spring](#tab/spring)
164135

165-
Edit the connection string configuration in `bootstrap.properties`, to use connection strings which allows a list of connection strings.
136+
Edit the endpoint configuration in `bootstrap.properties`, to use endpoints which allows a list of endpoints.
166137

167138
```properties
139+
# Only one method for connecting to a configuration store can be used.
140+
# Connect using AAD
141+
spring.cloud.azure.appconfiguration.stores[0].endpoints[0]="<first-replica-endpoint>"
142+
spring.cloud.azure.appconfiguration.stores[0].endpoints[1]="<second-replica-endpoint>"
143+
144+
# Connect using connection strings
168145
spring.cloud.azure.appconfiguration.stores[0].connection-strings[0]="${FIRST_REPLICA_CONNECTION_STRING}"
169146
spring.cloud.azure.appconfiguration.stores[0].connection-strings[1]="${SECOND_REPLICA_CONNECTION_STRING}"
170147
```
171-
172148
> [!NOTE]
173149
> The failover support is available if you use version of **4.7.0** or later of any of the following packages.
174150
> - `spring-cloud-azure-appconfiguration-config`

0 commit comments

Comments
 (0)