The tokenised configuration files need to be detokenised at deploy time. The settings are likely to include both sensitive and non-sensitive values. A core principle of CDAF for sensitive values is based on the 12-Factor approach of using environment variables, while source control is the recommended approach for non-sensitive values.
The Continuous Delivery Automation Framework (CDAF) has been engineered for enterprise scale implementations. Large scale organisations typically have a higher focus on gating and auditing, and to provide a change of configuration audit trail, along with a single way-of-working, the configuration changes are applied using the same principles as other deliveries, e.g application development.
From the CI process, the release package containers a dokenised SetParameters.xml
So now configuration management can be applied at deploy time. To provide a separation of concerns, where a user only wants to compare or change settings for environments, they do not have to understand the ASP.NET specific XML file formats, instead, they only need to review the configuration management tables.
CDAF does not have an opinionated view of configuration management files, but by convention, the key configuration settings are placed in properties.cm
in the SOLUTIONROOT. The field names in the configuration management file must match the tokens.
context target webAppSite webAppName sqlDBHost sqlDBName sqlDBUser sqlDBPassword
local TEST "Default Web Site" test nonprod test testuser $env:TEST_DB_PASS
local TEST "Default Web Site" uat nonprod uat uatuser $env:UAT_DB_PASS
local PROD "Default Web Site" prod prodsql prod produser $env:PROD_DB_PASS
During (Local)[https://docs.cdaf.io/mydoc_basics_local_tasks.html] or (Remote)[https://docs.cdaf.io/mydoc_basics_remote_tasks.html] deployment. The deployment task can now detokenise all properties for the application deployment. The CDAF Execution Engine is used to perform the deploy time detokenisation. CDAF environment variables are used to manipulate behaviour.
Write-Host "Detokenise the non-sensitive settings for this environment"
DETOKN MyAspApp.SetParameters.xml
Write-Host "Detokenise the sensitive settings, resolving, but not revealing, settings containing variable names"
$env:CDAF_OVERRIDE_TOKEN = '@'
DETOKN MyAspApp.SetParameters.xml $TARGET resolve
Write-Host "Use Web Deploy to deploy the Aware application"
.\MyAspApp.deploy.cmd /Y /M:localhost
The overview of how to construct and test this locally see the CDAF basics.