Skip to content

Commit 01762c6

Browse files
committed
update gin web app refresh doc
1 parent 9e8e51e commit 01762c6

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

articles/azure-app-configuration/enable-dynamic-configuration-gin-web-app.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,22 @@ author: linglingye
66
ms.service: azure-app-configuration
77
ms.devlang: golang
88
ms.topic: quickstart
9-
ms.date: 01/05/2024
9+
ms.date: 05/27/2025
1010
ms.author: linglingye
1111
ms.custom: devx-track-go
1212
---
1313

1414
# Tutorial: Use dynamic configuration in a Gin web app
1515

16-
This tutorial shows how you can implement dynamic configuration updates in a Gin web application using Azure App Configuration. It builds on the web app introduced in the previous quickstart. Before you continue, complete [Create a Gin web app with Azure App Configuration](./quickstart-go-web-app.md) first.
17-
18-
In this quickstart, you'll learn how to:
19-
20-
> [!div class="checklist"]
21-
> * Set up your Gin app to update its configuration in response to changes in an App Configuration store
22-
> * Implement a middleware to refresh configuration on incoming requests
23-
> * Inject the latest configuration into your app.
16+
This tutorial shows how you can implement dynamic configuration updates in a Gin web application using Azure App Configuration. It builds on the web app introduced in the previous quickstart.
2417

2518
## Prerequisites
2619

2720
Finish the quickstart: [Create a Gin web app with Azure App Configuration](./quickstart-go-web-app.md)
2821

2922
## Reload data from App Configuration
3023

31-
1. Open the file *`appconfig.go`*. Inside the `loadAzureAppConfiguration` function, update the `options` to enable refresh. Go provider will reload the entire configuration whenever it detects a change in any of the selected key-values (those starting with *Config.* and having no label). For more information about monitoring configuration changes, see [Best practices for configuration refresh](./howto-best-practices.md#configuration-refresh).
24+
1. Open the file *`appconfig.go`*. Inside the `loadAzureAppConfiguration` function, update the `options` to enable refresh. Go provider will reload the entire configuration whenever it detects a change in any of the selected key-values. For more information about monitoring configuration changes, see [Best practices for configuration refresh](./howto-best-practices.md#configuration-refresh).
3225

3326
```golang
3427
options := &azureappconfiguration.Options{
@@ -60,9 +53,9 @@ Finish the quickstart: [Create a Gin web app with Azure App Configuration](./qui
6053
// Register refresh callback
6154
provider.OnRefreshSuccess(func() {
6255
// Re-unmarshal the configuration
63-
err := provider.Unmarshal(&Config, nil)
56+
err := provider.Unmarshal(&config, nil)
6457
if err != nil {
65-
log.Printf("Error unmarshalling updated configuration: %s", err)
58+
log.Printf("Failed to unmarshal updated configuration: %s", err)
6659
return
6760
}
6861
})
@@ -128,7 +121,7 @@ Now that you've set up dynamic configuration refresh, let's test it to see it in
128121

129122
| Key | Value | Content type |
130123
|------------------------|----------------------------------------|--------------------|
131-
| *Config.Message* | * Hello from Azure App Configuration - now with live updates!* | Leave empty |
124+
| *Config.Message* | *Hello from Azure App Configuration - now with live updates!* | Leave empty |
132125

133126
4. After refreshing the browser a few times, you'll see the updated content once the ConfigMap is updated in 30 seconds.
134127

0 commit comments

Comments
 (0)