fe87e2d52c | ||
---|---|---|
.. | ||
internal | ||
CHANGELOG.md | ||
LICENSE.txt | ||
README.md | ||
assets.json | ||
ci.yml | ||
client.go | ||
client_test.go | ||
constants.go | ||
doc.go | ||
examples_test.go | ||
go.mod | ||
go.sum | ||
options.go | ||
response_types.go | ||
setting.go | ||
setting_selector.go | ||
snapshot.go | ||
test-resources.json | ||
utils_test.go | ||
version.go |
README.md
Azure App Configuration Client Module for Go
Azure App Configuration is a managed service that helps developers centralize their application and feature settings simply and securely. It allows you to create and manage application configuration settings and retrieve their revisions from a specific point in time.
Source code | Package (pkg.go.dev) | Product documentation
Getting started
Install the module
Install azappconfig
with go get
:
go get github.com/Azure/azure-sdk-for-go/sdk/data/azappconfig
Prerequisites
- An Azure subscription
- A supported Go version (the Azure SDK supports the two most recent Go releases)
- A Configuration store. If you need to create one, see the App Configuration documentation for instructions on doing so in the Azure Portal or with the Azure CLI.
Authentication
Azure App Configuration supports authenticating with Azure Active Directory and connection strings. To authenticate with Azure Active Directory, use the azappconfig.NewClient constructor and to authenticate with a connection string, use the azappconfig.NewClientFromConnectionString constructor. For simplicity, the examples demonstrate authenticating with a connection string.
See the azidentity documentation for more information about possible Azure Active Directory credential types.
Key concepts
A Setting is the fundamental resource within a Configuration Store. In its simplest form, it is a key and a value. However, there are additional properties such as the modifiable content type and tags fields that allow the value to be interpreted or associated in different ways.
The Label property of a Setting provides a way to separate Settings into different dimensions. These dimensions are user defined and can take any form. Some common examples of dimensions to use for a label include regions, semantic versions, or environments. Many applications have a required set of configuration keys that have varying values as the application exists across different dimensions.
For example, MaxRequests may be 100 in "NorthAmerica" and 200 in "WestEurope". By creating a Setting named MaxRequests with a label of "NorthAmerica" and another, only with a different value, with a "WestEurope" label, an application can seamlessly retrieve Settings as it runs in these two dimensions.
Examples
Examples for various scenarios can be found on pkg.go.dev or in the example*_test.go
files in our GitHub repo for azappconfig.
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.