|
1 | 1 | ---
|
2 |
| -title: Enable geo-replication (preview) |
| 2 | +title: Enable geo-replication |
3 | 3 | description: Learn how to use Azure App Configuration geo replication to create, delete, and manage replicas of your configuration store.
|
4 | 4 | services: azure-app-configuration
|
5 | 5 | author: mrm9084
|
6 | 6 | ms.service: azure-app-configuration
|
7 | 7 | ms.devlang: csharp, java
|
8 | 8 | ms.topic: how-to
|
9 |
| -ms.date: 10/10/2022 |
| 9 | +ms.date: 03/20/2023 |
10 | 10 | ms.author: mametcal
|
11 | 11 | ms.custom: devx-track-azurecli
|
12 | 12 |
|
13 | 13 | #Customer intent: I want to be able to list, create, and delete the replicas of my configuration store.
|
14 | 14 | ---
|
15 | 15 |
|
16 |
| -# Enable geo-replication (Preview) |
| 16 | +# Enable geo-replication |
17 | 17 |
|
18 | 18 | This article covers replication of Azure App Configuration stores. You'll learn about how to create, use and delete a replica in your configuration store.
|
19 | 19 |
|
@@ -90,49 +90,69 @@ Each replica you create has its dedicated endpoint. If your application resides
|
90 | 90 |
|
91 | 91 | When geo-replication is enabled, and if one replica isn't accessible, you can let your application failover to another replica for improved resiliency. App Configuration provider libraries have built-in failover support by accepting multiple replica endpoints. You can provide a list of your replica endpoints in the order of the most preferred to the least preferred endpoint. When the current endpoint isn't accessible, the provider library will fail over to a less preferred endpoint, but it will try to connect to the more preferred endpoints from time to time. When a more preferred endpoint becomes available, it will switch to it for future requests.
|
92 | 92 |
|
93 |
| -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. |
94 |
| - |
95 |
| -> [!NOTE] |
96 |
| -> You can only use Azure AD authentication to connect to replicas. Authentication with access keys is not supported during the preview. |
| 93 | +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 Azure Active Directory (Azure AD) authentication or a list of connection strings for access key-based authentication. |
97 | 94 |
|
98 | 95 | ### [.NET](#tab/dotnet)
|
99 | 96 |
|
100 | 97 | Edit the call to the `AddAzureAppConfiguration` method, which is often found in the `program.cs` file of your application.
|
101 | 98 |
|
| 99 | +**Connect with Azure AD** |
| 100 | + |
102 | 101 | ```csharp
|
103 | 102 | configurationBuilder.AddAzureAppConfiguration(options =>
|
104 | 103 | {
|
105 | 104 | // Provide an ordered list of replica endpoints
|
106 | 105 | var endpoints = new Uri[] {
|
107 |
| - new Uri("https://<first-replica-endpoint>.azconfig.io"), |
108 |
| - new Uri("https://<second-replica-endpoint>.azconfig.io") }; |
| 106 | + new Uri("<first-replica-endpoint>"), |
| 107 | + new Uri("<second-replica-endpoint>") }; |
109 | 108 |
|
110 |
| - // Connect to replica endpoints using AAD authentication |
| 109 | + // Connect to replica endpoints using Azure AD authentication |
111 | 110 | options.Connect(endpoints, new DefaultAzureCredential());
|
112 | 111 |
|
113 | 112 | // Other changes to options
|
114 | 113 | });
|
115 | 114 | ```
|
116 | 115 |
|
| 116 | +**Connect with Connection String** |
| 117 | + |
| 118 | +```csharp |
| 119 | +configurationBuilder.AddAzureAppConfiguration(options => |
| 120 | +{ |
| 121 | + // Provide an ordered list of replica connection strings |
| 122 | + var connectionStrings = new string[] { |
| 123 | + Environment.GetEnvironmentVariable("FIRST_REPLICA_CONNECTION_STRING"), |
| 124 | + Environment.GetEnvironmentVariable("SECOND_REPLICA_CONNECTION_STRING") }; |
| 125 | + |
| 126 | + // Connect to replica endpoints using connection strings |
| 127 | + options.Connect(connectionStrings); |
| 128 | + |
| 129 | + // Other changes to options |
| 130 | +}); |
| 131 | +``` |
| 132 | + |
117 | 133 | > [!NOTE]
|
118 |
| -> The failover support is available if you use version **5.3.0-preview** or later of any of the following packages. |
| 134 | +> The failover support is available if you use version **6.0.0** or later of any of the following packages. |
119 | 135 | > - `Microsoft.Extensions.Configuration.AzureAppConfiguration`
|
120 | 136 | > - `Microsoft.Azure.AppConfiguration.AspNetCore`
|
121 | 137 | > - `Microsoft.Azure.AppConfiguration.Functions.Worker`
|
122 | 138 |
|
123 | 139 | ### [Java Spring](#tab/spring)
|
124 | 140 |
|
125 |
| -Edit the endpoint configuration in `bootstrap.properties`, to use endpoints which allows a list of endpoints. |
| 141 | +Edit the `endpoints` or `connection-strings` properties in the `bootstrap.properties` file of your application. |
| 142 | + |
| 143 | +**Connect with Azure AD** |
126 | 144 |
|
127 | 145 | ```properties
|
128 |
| -spring.cloud.azure.appconfiguration.stores[0].endpoints[0]="https://<first-replica-endpoint>.azconfig.io" |
129 |
| -spring.cloud.azure.appconfiguration.stores[0].endpoints[1]="https://<second-replica-endpoint>.azconfig.io" |
| 146 | +spring.cloud.azure.appconfiguration.stores[0].endpoints[0]="<first-replica-endpoint>" |
| 147 | +spring.cloud.azure.appconfiguration.stores[0].endpoints[1]="<second-replica-endpoint>" |
130 | 148 | ```
|
| 149 | + |
| 150 | + |
131 | 151 | > [!NOTE]
|
132 |
| -> The failover support is available if you use version of **2.10.0-beta.1** or later of any of the following packages. |
133 |
| -> - `azure-spring-cloud-appconfiguration-config` |
134 |
| -> - `azure-spring-cloud-appconfiguration-config-web` |
135 |
| -> - `azure-spring-cloud-starter-appconfiguration-config` |
| 152 | +> The failover support is available if you use version of **4.0.0-beta.1** or later of any of the following packages. |
| 153 | +> - `spring-cloud-azure-appconfiguration-config` |
| 154 | +> - `spring-cloud-azure-appconfiguration-config-web` |
| 155 | +> - `spring-cloud-azure-starter-appconfiguration-config` |
136 | 156 |
|
137 | 157 | ---
|
138 | 158 |
|
|
0 commit comments