My question is around updating an appsetting value, in the Post-deployment script section to a Project Variables value?
We have a value that often updates, and I thus can’t do a powershell replace since this value changes.
The pre-deployment script section intentionally removes the web.config file, and thus I cannot update this value there. I can only update this value to the existing web.config that is not included in the deploy.
Thus, how in the post deployment script section could I update the “MyKey” value to Project Variable “MyProjectVariable” (e.g. #{Octopus.Release.Number} )
Octopus’ Variable Replacement feature is executed before the post deployment scripts, so in your case you’ll need to write your own Powershell script to replace the value in your xml config file using something like this: https://stackoverflow.com/a/16429111