For a long time now, App Settings have been the way to configure your app’s settings such as environment variables and connection strings for Azure App Services.
In February 2019, Microsoft announced a new service called App Configuration – which, currently in preview – allows you to easily centralise your app settings across multiple resources.
Why is App Settings a problem?
App Settings are great – if you only need those settings for one resource (eg. an app service). But if you’re working with, say, a microservice that might be made up of many resources including an app service and maybe a functions app that all share similar configurations, keeping track of what settings were made where can quickly become problematic.
Amongst other things, there’s no easy way to do things like point-in-time replays of settings, so you can see what changed or keep the settings the same if you need to rebuild or deploy a specific version of your app.
What does App Configuration offer that App Settings doesn’t?
App Configuration is a fully managed service that offers the ability to store all your app configuration values in one location, with the ability to compare settings at specific times and with specific labels.
Operating in a similar fashion to Key Vault, it’s a separate resource from your app service (although you can configure it immediately by going to the new preview tab in your app services), and there are a number of SDKs available to integrate with it for .NET core, .NET and Java.
You can think of App Configuration as a counterpart to Key Vault for properties that don’t need to be stored as secrets. Connection strings would likely still go in Key Vault, but properties that aren’t secrets should be stored in App Configuration.
First you’ll need to setup a connection string which you can find under the “Settings” → “Access Keys” section of your App Configuration resource. Then, within App Configuration, you set a number of key value pairs, which you can then access in a similar fashion to the way you get environment variables in App Settings:
var configBuilder = new ConfigurationBuilder(); var config = Environment.GetEnvironmentVariable("YourKeyNameFromAppConfiguration") configBuilder.AddAzureAppConfiguration(config); var config = configBuilder.Build();
You can also import and export settings easily, and can use JSON, YAML or a Properties file. You can also export the settings for a specific time and date.
At present, because the service is in preview there are no additional charges. Microsoft hasn’t yet stated its intentions for charging for this service, but given the similarities with Key Vault (which is a paid service) it’s easy to see how a similar model could apply if they decided.