Skip to content

Commit 5e1f5fc

Browse files
Merge pull request #208942 from zhenlan/failover
Add config provider failover instructions
2 parents 6cc9bf7 + 7a8a76e commit 5e1f5fc

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

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

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.custom: devx-track-azurecli
1515

1616
# Enable geo-replication (Preview)
1717

18-
This article covers replication of Azure App Configuration stores. You'll learn about how to create and delete a replica in your configuration store.
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.
1919

2020
To learn more about the concept of geo-replication, see [Geo-replication in Azure App Configuration](./concept-soft-delete.md).
2121

@@ -84,6 +84,49 @@ To delete a replica in the portal, follow the steps below.
8484
8585
--- -->
8686

87+
## Use replicas
88+
89+
Each replica you create has its dedicated endpoint. If your application resides in multiple geolocations, you can update each deployment of your application in a location to connect to the replica closer to that location, which helps minimize the network latency between your application and App Configuration. Since each replica has its separate request quota, this setup also helps the scalability of your application while it grows to a multi-region distributed service.
90+
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. You can update your application as the sample code below to take advantage of the failover feature.
92+
93+
> [!NOTE]
94+
> You can only use Azure AD authentication to connect to replicas. Authentication with access keys is not supported during the preview.
95+
96+
<!-- ### [.NET](#tab/dotnet) -->
97+
98+
```csharp
99+
configurationBuilder.AddAzureAppConfiguration(options =>
100+
{
101+
// Provide an ordered list of replica endpoints
102+
var endpoints = new Uri[] {
103+
new Uri("https://<first-replica-endpoint>.azconfig.io"),
104+
new Uri("https://<second-replica-endpoint>.azconfig.io") };
105+
106+
// Connect to replica endpoints using AAD authentication
107+
options.Connect(endpoints, new DefaultAzureCredential());
108+
109+
// Other changes to options
110+
});
111+
```
112+
113+
> [!NOTE]
114+
> The failover support is available if you use version **5.3.0-preview** or later of any of the following packages.
115+
> - `Microsoft.Extensions.Configuration.AzureAppConfiguration`
116+
> - `Microsoft.Azure.AppConfiguration.AspNetCore`
117+
> - `Microsoft.Azure.AppConfiguration.Functions.Worker`
118+
119+
<!-- ### [Java Spring](#tab/spring)
120+
Placeholder for Java Spring instructions
121+
--- -->
122+
123+
The failover may occur if the App Configuration provider observes the following conditions.
124+
- Receives responses with service unavailable status (HTTP status code 500 or above).
125+
- Experiences with network connectivity issues.
126+
- Requests are throttled (HTTP status code 429).
127+
128+
The failover won't happen for client errors like authentication failures.
129+
87130
## Next steps
88131

89132
> [!div class="nextstepaction"]

0 commit comments

Comments
 (0)