Azure App Configuration provides a service to centrally manage application settings and feature flags.

  • Explain the benefits of using Azure App Configuration
  • Describe how Azure App Configuration stores information
  • Implement feature management
  • Securely access your app configuration information

Modern programs, especially programs running in cloud are, generally have many components that are distributed in nature. Spreading the application settings across these distributed components can lead to hard to troubleshoot issues during application deployment. Use App Configuration to store and manage all the application settings in one central location.

Benefits of using App Configuration:

  • Flexible key representation and mappings
  • Fully managed service with ease of setup
  • Native integration with .net core, .net , java etc
  • Enhanced security using Azure Managed Identities
  • Point in time replay of settings
  • UI for feature flag management
  • Version comparison
  • Dynamically change application settings without the need to redeploy or restart an application
  • Control feature availability in real-time

Azure App Configuration stores configuration data as key-value pairs.

Keys

Key’s serve as name for key-value pairs and help in retrieving corresponding values. Keys can be organized in any manner that’s best suitable for application.

General rules :

  • Keys are case sensitive, unicode-based strings. So app1 and App1 are different keys in App configuration store
  • Key names can have any unicode character except the few reserved ones like '*', ',' and '\'. To use the reserved characters escape it using \{Reserved Character}.
  • There is a combined size limit of 10,000 characters for a key-value pair

Design key namespaces:

There are two general approaches to naming keys used for configuration data: flat or hierarchical. These methods are similar from an application usage standpoint, but hierarchical naming offers a number of advantages:

  • Easier to read. Instead of one long sequence of characters, delimiters in a hierarchical key name function as spaces in a sentence.
  • Easier to manage. A key name hierarchy represents logical groups of configuration data.
  • Easier to use. It’s simpler to write a query that pattern-matches keys in a hierarchical structure and retrieves only a portion of configuration data.

Below are examples :

AppName:Service1:ApiEndpoint
AppName:Service2:ApiEndpoint
AppName:Region1:DbConectionString
AppName:Region2:DbConectionString

Keys with different label values allow to create different variants of the same key

Key = AppName:AsbConectionString & Label = Test
Key = AppName:AsbConectionString & Label = Staging
Key = AppName:AsbConectionString & Label = Production

Another use of label values can be to version the keys since App Configuration doesn’t automatically create versions when keys are modified

Query key values

Each key value is uniquely identified by its key plus a label that can be null. You query an App Configuration store for key values by specifying a pattern. The App Configuration store returns all key values that match the pattern and their corresponding values and attributes.

Values

Values assigned to keys are also unicode strings. You can use all unicode characters for values.

Feature Management

Feature management is a modern software development practice that separates feature release and code release and allows features to be managed in real time by enabling feature availability on demand. It uses feature flags to dynamically administer a features lifecycle

  • Feature flag: A feature flag is a variable with a binary state of on or off. The feature flag also has an associated code block. The state of the feature flag triggers whether the code block runs or not.
  • Feature manager: A feature manager is an application package that handles the lifecycle of all the feature flags in an application. The feature manager typically provides additional functionality, such as caching feature flags and updating their states.
  • Filter: A filter is a rule for evaluating the state of a feature flag. A user group, a device or browser type, a geographic location, and a time window are all examples of what a filter can represent.

An effective implementation of feature management consists of at least two components working in concert:

  • An application that makes use of feature flags.
  • A separate repository that stores the feature flags and their current states.

Azure App Configuration is designed to be a centralized repository for feature flags allowing to define different kinds of feature flags and manage them in real time.

Securing app configuration data

App configuration data can be secured by using :

  • Customer managed keys
  • Private endpoints
  • Managed Identities

Azure App Configuration encrypts sensitive information at rest using a 256-bit AES encryption key provided by Microsoft.