When building Cloud Native applications, one of the key principles is to separate configuration from code (https://12factor.net/config). Ideally, like the infrastructure, you want this configuration captured in the code. After all, this offers benefits such as versioning, traceability, and manageability. In this article, we will take you through how this can be applied using Azure App Configuration and Azure Key Vault.
At Intercept, we build Cloud Native applications ourselves and help our customers make their applications Cloud Native (Read more about how we do that here). All these applications use configuration, which often differs between environments (test, acceptance, and production). Here we always distinguish between sensitive and non-sensitive configurations. In this blog post, we use an application built in .Net 7. We deploy this application to Azure using GitHub Actions.
Saving the configuration
To save our configuration, we create a new folder in our repository (e.g., /config). For each environment, we create an appsettings[environmentname].json. In these files, we can specify our configuration as key-value pairs. If desired, nesting of values is possible.