Skip to content

Commit 3098d57

Browse files
Merge pull request #304508 from linglingye001/go/failover
Failover: add Go scenarios
2 parents a4ea1c0 + 1e1a621 commit 3098d57

2 files changed

Lines changed: 37 additions & 3 deletions

File tree

articles/azure-app-configuration/configuration-provider-overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ Variant Feature Flags | [GA](./reference-dotnet-provider.md#feature-flag) | Prev
6565
Feature Flag Telemetry | GA | Preview | WIP | GA | GA | WIP
6666
Key Prefix Trim | [GA](./reference-dotnet-provider.md#trim-prefix-from-keys) | GA | GA | GA | [GA](./reference-javascript-provider.md#trim-prefix-from-keys) | GA
6767
Configurable Startup Time-out | [GA](./reference-dotnet-provider.md#startup-retry) | WIP | N/A | WIP | [GA](./reference-javascript-provider.md#startup-retry) | WIP
68-
Replica Auto Discovery | [GA](./reference-dotnet-provider.md#geo-replication) | GA | GA | GA | [GA](./reference-javascript-provider.md#geo-replication) | WIP
69-
Replica Failover | [GA](./reference-dotnet-provider.md#geo-replication) | GA | GA | GA | [GA](./reference-javascript-provider.md#geo-replication) | WIP
70-
Replica Load Balancing | [GA](./reference-dotnet-provider.md#geo-replication) | WIP | GA | GA | [GA](./reference-javascript-provider.md#geo-replication) | WIP
68+
Replica Auto Discovery | [GA](./reference-dotnet-provider.md#geo-replication) | GA | GA | GA | [GA](./reference-javascript-provider.md#geo-replication) | GA
69+
Replica Failover | [GA](./reference-dotnet-provider.md#geo-replication) | GA | GA | GA | [GA](./reference-javascript-provider.md#geo-replication) | GA
70+
Replica Load Balancing | [GA](./reference-dotnet-provider.md#geo-replication) | WIP | GA | GA | [GA](./reference-javascript-provider.md#geo-replication) | GA
7171
Snapshots | [GA](./reference-dotnet-provider.md#snapshot) | GA | GA | WIP | [GA](./reference-javascript-provider.md#snapshot) | WIP
7272
Distributed Tracing | [GA](./reference-dotnet-provider.md#distributed-tracing) | WIP | WIP | WIP | WIP | WIP
7373
Health Check | [GA](./reference-dotnet-provider.md#health-check) | GA | WIP | WIP | WIP | WIP

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,22 @@ const config = load(endpoint, credential, {
174174
> The automatic replica discovery support is available if you use version **2.0.0** or later of [@azure/app-configuration-provider](https://www.npmjs.com/package/@azure/app-configuration-provider).
175175
> The feature is not available for browser-based applications due to the restriction of browser security sandbox.
176176

177+
### [Go](#tab/go)
178+
179+
Specify the `azureappconfiguration.Options.ReplicaDiscoveryEnabled` property when loading the configuration store and set it to `false`.
180+
181+
```golang
182+
replicaDiscoveryEnabled := false
183+
options := azureappconfiguration.Options{
184+
ReplicaDiscoveryEnabled: &replicaDiscoveryEnabled,
185+
}
186+
187+
appConfig, err := azureappconfiguration.Load(ctx, authOptions, options)
188+
```
189+
190+
> [!NOTE]
191+
> The automatic replica discovery support is available if you use version **1.2.0** or later of [azureappconfiguration](https://pkg.go.dev/github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration).
192+
177193
---
178194

179195
## Scale and failover with replicas
@@ -264,6 +280,10 @@ The Azure App Configuration Python Provider supports failover with automatically
264280

265281
The Azure App Configuration JavaScript Provider supports failover with automatically discovered replicas by default, as long as automatic replica discovery isn't disabled. It doesn't support or require user-provided replicas.
266282

283+
### [Go](#tab/go)
284+
285+
The Azure App Configuration Go Provider supports failover with automatically discovered replicas by default, as long as automatic replica discovery isn't disabled. It doesn't support or require user-provided replicas.
286+
267287
---
268288

269289
The failover may occur if the App Configuration provider observes the following conditions.
@@ -339,6 +359,20 @@ const config = load(endpoint, credential, {
339359
> [!NOTE]
340360
> Load balancing support is available if you use version **2.0.0** or later of [@azure/app-configuration-provider](https://www.npmjs.com/package/@azure/app-configuration-provider).
341361

362+
### [Go](#tab/go)
363+
364+
Set `azureappconfiguration.Options.LoadBalancingEnabled` to `true` while loading configuration from App Configuration.
365+
366+
```golang
367+
options := azureappconfiguration.Options{
368+
LoadBalancingEnabled: true,
369+
}
370+
371+
appConfig, err := azureappconfiguration.Load(ctx, authOptions, options)
372+
```
373+
> [!NOTE]
374+
> Load balancing support is available if you use version **1.2.0** or later of [azureappconfiguration](https://pkg.go.dev/github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration).
375+
342376
---
343377

344378
## Next steps

0 commit comments

Comments
 (0)