Skip to content

Commit a856b5a

Browse files
Merge pull request #307375 from linglingye001/goprovider/ref/tagFilter
Add tag filter example
2 parents fb8d725 + 665e874 commit a856b5a

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Replica Load Balancing | [GA](./reference-dotnet-provider.md#geo-replication) |
7171
Snapshots | [GA](./reference-dotnet-provider.md#snapshot) | GA | GA | WIP | [GA](./reference-javascript-provider.md#snapshot) | GA
7272
Distributed Tracing | [GA](./reference-dotnet-provider.md#distributed-tracing) | WIP | WIP | WIP | WIP | N/A
7373
Health Check | [GA](./reference-dotnet-provider.md#health-check) | GA | WIP | WIP | WIP | N/A
74-
Select by Tag Filters | [GA](./reference-dotnet-provider.md#load-specific-key-values-using-selectors) | WIP | WIP | GA | [GA](./reference-javascript-provider.md#tag-filters) | WIP
74+
Select by Tag Filters | [GA](./reference-dotnet-provider.md#load-specific-key-values-using-selectors) | WIP | WIP | GA | [GA](./reference-javascript-provider.md#tag-filters) | GA
7575
Snapshot Reference | [GA](./reference-dotnet-provider.md#snapshot-reference) | WIP | WIP | WIP | WIP | WIP
7676

7777
## Support policy

articles/azure-app-configuration/reference-go-provider.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,27 @@ The `Selector` struct supports the following fields:
138138
> [!NOTE]
139139
> When multiple selectors include overlapping keys, later selectors take precedence over earlier ones.
140140
141+
#### Tag filters
142+
143+
The `TagFilters` parameter selects key-values with specific tags. A key-value is only loaded if it has all of the tags and corresponding values specified in the filters.
144+
145+
```golang
146+
options := &azureappconfiguration.Options{
147+
Selectors: []azureappconfiguration.Selector{
148+
{
149+
// Load configuration values with prefix "App:" and specific tags
150+
KeyFilter: "App:*",
151+
TagFilters: []string{"env=prod"},
152+
},
153+
},
154+
}
155+
156+
appConfig, err := azureappconfiguration.Load(ctx, authOptions, options)
157+
```
158+
159+
> [!NOTE]
160+
> The characters asterisk (`*`), comma (`,`), and backslash (`\`) are reserved and must be escaped with a backslash when used in a tag filter.
161+
141162
### Trim prefix from keys
142163

143164
When loading configuration values with specific prefixes, you can use the `TrimKeyPrefixes` option to remove those prefixes from the keys in your configuration. This creates cleaner configuration keys in your application while maintaining organization in your App Configuration store.

0 commit comments

Comments
 (0)