Yahoo Canada Web Search

Search results

  1. Nov 3, 2022 · We will be using Azure to host this Configuration Manager. The key here is that each instance of our application can have configuration changes pushed to it individually, not all application nodes will be configured the same.

    • Overview
    • Key groupings
    • Key-value compositions
    • References to external data
    • App Configuration bootstrap
    • Azure Kubernetes Service access to App Configuration
    • App Service or Azure Functions access to App Configuration
    • Reduce requests made to App Configuration
    • Importing configuration data into App Configuration
    • Multi-region deployment in App Configuration

    This article discusses common patterns and best practices when you're using Azure App Configuration.

    App Configuration provides two options for organizing keys:

    •Key prefixes

    •Labels

    You can use either one or both options to group your keys.

    Key prefixes are the beginning parts of keys. You can logically group a set of keys by using the same prefix in their names. Prefixes can contain multiple components connected by a delimiter, such as /, similar to a URL path, to form a namespace. Such hierarchies are useful when you're storing keys for many applications and microservices in one App Configuration store.

    An important thing to keep in mind is that keys are what your application code references to retrieve the values of the corresponding settings. Keys shouldn't change, or else you'll have to modify your code each time that happens.

    App Configuration treats all keys stored with it as independent entities. App Configuration doesn't attempt to infer any relationship between keys or to inherit key values based on their hierarchy. You can aggregate multiple sets of keys, however, by using labels coupled with proper configuration stacking in your application code.

    Let's look at an example. Suppose you have a setting named Asset1, whose value might vary based on the development environment. You create a key named "Asset1" with an empty label and a label named "Development". In the first label, you put the default value for Asset1, and you put a specific value for "Development" in the latter.

    In your code, you first retrieve the key values without any labels, and then you retrieve the same set of key values a second time with the "Development" label. When you retrieve the values the second time, the previous values of the keys are overwritten. The .NET Core configuration system allows you to "stack" multiple sets of configuration data on top of each other. If a key exists in more than one set, the last set that contains it is used. With a modern programming framework, such as .NET Core, you get this stacking capability for free if you use a native configuration provider to access App Configuration. The following code snippet shows how you can implement stacking in a .NET Core application:

    Use labels to enable different configurations for different environments provides a complete example.

    App Configuration is designed to store any configuration data that you would normally save in configuration files or environment variables. However, some types of data may be better suited to reside in other sources. For example, store secrets in Key Vault, files in Azure Storage, membership information in Microsoft Entra groups, or customer lists in a database.

    You can still take advantage of App Configuration by saving a reference to external data in a key-value. You can use content type to differentiate each data source. When your application reads a reference, it loads the actual data from the referenced source, assuming it has the necessary permission to the source. If you change the location of your external data, you only need to update the reference in App Configuration instead of updating and redeploying your entire application.

    To access an App Configuration store, you can use its connection string, which is available in the Azure portal. Because connection strings contain credential information, they're considered secrets. These secrets need to be stored in Azure Key Vault, and your code must authenticate to Key Vault to retrieve them.

    A better option is to use the managed identities feature in Microsoft Entra ID. With managed identities, you need only the App Configuration endpoint URL to bootstrap access to your App Configuration store. You can embed the URL in your application code (for example, in the appsettings.json file). See Use managed identities to access App Configuration for details.

    The following options are available for workloads hosted in Azure Kubernetes Service (AKS) to access Azure App Configuration. These options also apply to Kubernetes in general.

    •Add Azure App Configuration Kubernetes Provider to your AKS cluster. The Kubernetes provider runs as a pod in the cluster. It can construct ConfigMaps and Secrets from key-values and Key Vault references in your App Configuration store. The ConfigMap and Secret are consumable as environment variables or mounted files without requiring any modifications to your application code. If you have multiple applications running in the same AKS cluster, they can all access the generated ConfigMaps and Secrets, eliminating the need for individual requests to App Configuration. The Kubernetes provider also supports dynamic configuration updates. This is the recommended option if feasible for you.

    •Update your application to use Azure App Configuration provider libraries. The provider libraries are available in many frameworks and languages, such as ASP.NET, .NET, Java Spring, JavaScript/Node.js, and Python. This approach gives you full access to App Configuration's functionalities, including dynamic configuration and feature management. You have granular control of what data to load and from which App Configuration store for each application.

    •Integrate with Kubernetes deployment using Helm. If you do not wish to update your application or add a new pod to your AKS cluster, you have the option of bringing data from App Configuration to your Kubernetes cluster by using Helm via deployment. This approach enables your application to continue accessing configuration from Kubernetes variables and Secrets. You can run Helm upgrade whenever you want your application to incorporate new configuration changes.

    Use the App Configuration provider or SDK libraries to access App Configuration directly in your application. This approach gives you full access to App Configuration's functionalities, including dynamic configuration and feature management. Your application running on App Service or Azure Functions can obtain access to your App Configuration store via any of the following methods:

    •Enable managed identity on your App Service or Azure Functions and grant it access to your App Configuration store. For more information, see Use managed identities to access App Configuration.

    •Store the connection string to your App Configuration store in the Application settings of App Service or Azure Functions. For enhanced security, store the connection string in Key Vault and reference it from App Service or Azure Functions.

    You can also make your App Configuration data accessible to your application as Application settings or environment variables. With this approach, you can avoid changing your application code.

    •Add references to your App Configuration data in the Application settings of your App Service or Azure Functions. App Configuration offers tools to export a collection of key-values as references at once. For more information, see Use App Configuration references for App Service and Azure Functions.

    •Export your App Configuration data to the Application settings of your App Service or Azure Functions without selecting the option of export-as-reference. Export your data again every time you make new changes in App Configuration if you like your application to pick up the change.

    Excessive requests to App Configuration can result in throttling or overage charges. To reduce the number of requests made:

    •Increase the refresh timeout, especially if your configuration values do not change frequently. Specify a new refresh timeout using the SetCacheExpiration method.

    •Watch a single sentinel key, rather than watching individual keys. Refresh all configuration only if the sentinel key changes. See Use dynamic configuration in an ASP.NET Core app for an example.

    •Use Azure Event Grid to receive notifications when configuration changes, rather than constantly polling for any changes. For more information, see Use Event Grid for App Configuration data change notifications.

    App Configuration offers the option to bulk import your configuration settings from your current configuration files using either the Azure portal or CLI. You can also use the same options to export key-values from App Configuration, for example between related stores. If you’d like to set up an ongoing sync with your repo in GitHub or Azure DevOps...

    If your application is deployed in multiple regions, we recommend that you enable geo-replication of your App Configuration store. You can let your application primarily connect to the replica matching the region where instances of your application are deployed and allow them to fail over to replicas in other regions. This setup minimizes the laten...

  2. Jan 16, 2024 · The App Configuration Java Spring client library supports updating configuration on demand without causing an application to restart. An application can be configured to detect changes in App Configuration using one or both of the following two approaches.

  3. Apr 6, 2022 · Configuration as code is a valuable mechanism for managing your applications across instances. It allows you to define your environment in a way that can be traced, collaborated on and...

  4. Sep 17, 2024 · When you load a single tenant's configuration into your application, you can specify a key prefix filter to only load that tenant's keys. You can also configure the provider library for Azure App Configuration to trim the key prefix from the keys, before it makes them available to your application.

  5. Sep 27, 2023 · If you have multiple instances of your application running, you can use the appconfiguration-refresh-bus endpoint which requires setting up Azure Service Bus, which is used to send a message to all instances of your application to refresh their configuration. This is useful if you have multiple instances of your application running and want to ...

  6. People also ask

  7. Oct 7, 2019 · Its possible, of course, to push new settings and restart all application instances to pick up the updates, but that could result in unnecessary downtime. If you’re a Java developer and use...