Azure App Configuration: A Practical Guide

Azure App Configuration Blog Banner

What Is the Azure App Configuration Service? 

App Configuration is a managed service provided by Microsoft Azure that offers a central place for managing application settings and feature flags. It simplifies the task of keeping application settings in sync across various environments, such as development, testing, and production. 

By centralizing configuration settings, developers can easily modify application behavior without the need to redeploy or change code. This service supports dynamic configuration changes at runtime, enabling applications to be more adaptable and easier to manage.

The service provides features for managing app configurations, including the ability to group configurations into labels, use feature flags for toggling functionality without deploying new code, and secure sensitive information with encryption. It integrates seamlessly with popular Azure services like Azure Functions and Azure App Service, enhancing developer productivity. 
This is part of a series of articles about configuration management software.

Why Use Azure App Configuration? 

Azure App Configuration simplifies complex application settings management. It enables centralized control of configuration settings, reducing errors and inconsistencies across distributed environments. By decoupling configuration from code, App Configuration enables smooth deployments and easier maintenance of applications across various stages of development and production.

Azure App Configuration improves application resilience by enabling real-time updates to configurations without the need for redeployment or downtime. This is useful for maintaining continuous availability and adapting quickly to changing requirements in cloud environments. 

Tips From the Expert

In my experience, here are tips that can help you better utilize Azure App Configuration for efficient and secure configuration management:

  1. Automate version management with labels Use labels for versioning configuration settings across different environments (e.g., dev, staging, prod) and deployments. Automate this process through CI/CD pipelines to easily switch configurations or roll back to previous versions by just modifying the label, without code changes.

  2. Leverage feature flags for gradual rollouts Use feature flags to gradually release new features by enabling them for a small subset of users or regions. This approach allows you to test features in production and reduce the risk of failures during deployment. Integrate with App Configuration’s feature management API for dynamic toggling.

  3. Implement security with managed identities Secure access to the App Configuration store by using Azure Managed Identities instead of connection strings. Managed identities eliminate the need to store sensitive credentials and allow for seamless authentication and authorization within Azure services.

  4. Utilize Key Vault for secrets Store sensitive configuration values like API keys and database credentials in Azure Key Vault, and reference them from App Configuration. This ensures sensitive data is encrypted and follows best practices for secret management while using App Configuration for non-sensitive settings.

  5. Optimize for large-scale apps with hierarchical keys Use a hierarchical key structure (e.g., App:Module:Setting) to organize settings for different modules or services within a large-scale application. This makes it easier to manage, update, and retrieve configurations specific to particular components.

Ran Cohen photo
Ran Cohen
CTO & Co-Founder. Configu
Before co-founding Configu, Ran was a full stack developer at Testim.io and previously served in an elite cybersecurity unit in the Israeli Defense Forces.

Azure App Configuration Key Features

Azure App Configuration offers several key features designed to simplify the management of application settings and enhance application performance and security:

  • Centralized Configuration Management: Provides a single place to manage application settings and feature flags, reducing the complexity of handling configurations across multiple environments and services.
  • Dynamic Configuration Changes: Allows real-time updates to application settings without requiring redeployment, enabling more responsive and adaptable applications.
  • Feature Flags: Enables the use of feature flags to toggle features on or off dynamically. This is particularly useful for A/B testing, gradual rollouts, and instant rollbacks of features.
  • Flexible Key-Value Store: Offers a flexible key-value store for configuration settings, supporting hierarchical configurations and enabling easy organization and retrieval of settings.
  • Labeling and Tagging: Supports tagging and labeling configurations, which helps in organizing settings and facilitates version control, especially in multi-environment scenarios.
  • Point-in-Time Replay: Allows replaying configurations at specific points in time, aiding in troubleshooting and ensuring consistency across deployments.

Azure App Configuration Pricing 

Azure App Configuration offers two pricing tiers: Free and Standard. The Free tier provides a single configuration store per subscription, with 10 MB of storage and a 7-day revision history. Users are allocated a request quota of 1,000 requests per day, after which they receive HTTP status code 429 for any additional requests until the end of the day.

The Standard tier allows for unlimited configuration stores, providing 1 GB of storage and a 30-day revision history per resource. It significantly increases the request quota to 30,000 requests per hour per resource. If this limit is exceeded, similar to the Free tier, subsequent requests may also return HTTP status code 429 until the next hour begins. 

Pricing for the Standard tier starts at $1.20 per store per day, which includes the first 200,000 requests; additional requests incur an overage charge of $0.06 per 10,000 requests. This tier also introduces features like encryption with customer-managed keys and Geo Replication for enhanced security and availability.

Tutorial: Create an Azure App Configuration Store

Ensure you have an Azure account with an active subscription. If you don’t have an account, you can create one for free on the Azure website.

To create an App Configuration store:

  1. Go to the Azure portal’s homepage and enter App Configuration in the search box at the top. Select App Configuration from the search results.
  2. Click on the Create button to start the creation process. 
  3. In the Basics tab, fill in the following fields:
  • Subscription: Choose your Azure subscription.
  • Resource Group: Select an existing resource group or create a new one, such as AppConfigTestResources.
  • Location: Choose a region close to other components of your application, for example, Central US.
  • Resource Name: Enter a unique name for your App Configuration store. The name should be between 5 and 50 characters, containing only letters, numbers, and hyphens. It should not start or end with a hyphen.
  • Pricing Tier: Select Free for this tutorial. The Free tier provides basic features. If you need advanced features like geo-replication, you can opt for the Standard tier.

Source: Azure

  1. Click on Review + create to validate your settings. After the validation, click Create. The deployment process may take a few minutes.
  2. Once the deployment is complete, navigate to your App Configuration resource. Go to Settings, then Access keys and note down the primary read-only key connection string. This connection string will be used to connect your application to the App Configuration store.

Adding Key-Value Pairs

After setting up the App Configuration store, you can add key-value pairs to manage your application settings:

  1. In your App Configuration resource, go to Operations, then Configuration explorer.
  2. Click on Create, select Key-value, and fill in the following fields:
  • Key: Enter the key name, for example, TestApp:Settings.
  • Value: Enter the corresponding value, such as center.
  • Label and Content type: Leave these fields with their default values unless you have specific requirements.

Source: Azure

  1. Click Apply to save the key-value pair to your App Configuration store.

Azure App Configuration Best Practices

Here are some of the ways to make the most of the Azure App Configuration service.

Use Key Groupings 

Organizing keys in App Configuration can be achieved through key prefixes and labels. Key prefixes, which are the initial segments of keys, allow for logical grouping of related settings by using consistent prefixes in their names. 

This hierarchical structure, resembling a URL path with components separated by delimiters like slashes, makes it easier to manage configurations for multiple applications or services within a single App Configuration store.

Labels serve as key attributes to differentiate or version settings. By tagging keys with labels, configurations can be tailored for specific environments or iterations without altering the key names themselves. This enables applications to switch between different sets of configurations by specifying the desired label, keeping code changes to a minimum. 

Use Key-Value Compositions 

App Configuration treats each key as an independent entity without assuming relationships or hierarchies among them. This allows for precise control over configuration settings by aggregating keys using labels and application-side configuration stacking. 

For example, you can define a default value for a setting and override it for specific environments like development or production by using labels. This method ensures that changes to environment-specific configurations do not require code alterations, maintaining consistency across various deployment stages.

The process involves retrieving a base set of configurations without labels followed by an environment-specific set with labels, such as Development. This overwrites any matching keys with environment-specific values. Using the .NET configuration system’s stacking feature simplifies this approach, allowing applications to switch between different configuration sets based on the specified label.

Reduce Requests Made to App Configuration 

To minimize the frequency of requests to Azure App Configuration and avoid potential throttling or additional charges, it’s recommended to adjust the refresh timeout for configuration values. This is particularly useful when configuration data does not frequently change. By extending the cache expiration time through the SetCacheExpiration method, applications reduce the need for frequent updates.

Another strategy involves using a sentinel key to monitor changes across multiple configurations. Instead of tracking individual keys for modifications, applications can watch a single sentinel key and refresh all configurations only if this key changes. This approach simplifies change detection and reduces the number of requests sent to App Configuration.  

Configuration Management with Configu

Configu is a configuration management platform comprised of two main components:

Configu Orchestrator

As applications become more dynamic and distributed in microservices architectures, configurations are getting more fragmented. They are saved as raw text that is spread across multiple stores, databases, files, git repositories, and third-party tools (a typical company will have five to ten different stores). Configu can work as a stand-alone platform or as an orchestrator for secrets managers, feature flags and other stores. It has built-in support for popular feature flag managers, such as Launch Darkly.

The Configu Orchestrator, which is open-source software, is a powerful standalone tool designed to address this challenge by providing configuration orchestration along with Configuration-as-Code (CaC) approach.

Configu Cloud

Configu Cloud is the most innovative store purpose-built for configurations, including environment variables, secrets, and feature flags. It is built based on the Configu configuration-as-code (CaC) approach and can model configurations and wrap them with unique layers, providing collaboration capabilities, visibility into configuration workflows, and security and compliance standardization.

Unlike legacy tools, which treat configurations as unstructured data or key-value pairs, Configu is leading the way with a Configuration-as-Code approach. By modeling configurations, they are treated as first-class citizens in the developers’ code. This makes our solution more robust and reliable and also enables Configu to provide more capabilities, such as visualization, a testing framework, and security abilities.

Learn more about Configu

Related Content

AWS AppConfig: The Basics and a Quick Tutorial

Configuration Management Software: Infrastructure vs. Applications

Try Configu for free
Painless end-to-end configuration management platform
Get Started for Free