I’ve written a powershell script which will perform a similar action to that included for .config files but for .json files - in that it’ll replace any variables in the file with the Octopus held version. I thought it’d be something that’d be worth making general and including for you - it’d be absolutely brilliant if it could be an option on a site for instance. It does require Powershell 3 though.
Hope someone finds it useful.
$filename = $OctopusParameters[‘Octopus.Action[Deploy Web Site].Output.Package.InstallationDirectoryPath’] + “/config.json”
$json = (Get-Content $filename -Raw) | ConvertFrom-Json
foreach($variable in $OctopusParameters.GetEnumerator())
$key = $variable.Key
$json.$key = $variable.Value
$json |ConvertTo-Json | Out-File $filename