Hi Endashaw,
Thank you for reaching out, and sorry to hear you are having trouble using the Substitute Variables in Template
feature within Octopus Deploy, but I would be happy to help take a closer look at things.
As an initial step, it sounds like you might have things set right but are not targeting the Web.config
file properly:
For the “Target files” field, you need to provide the path relative to the package extraction directory (the root of where your deployment package gets extracted). For instance, if your Web.config
is in the root of your application, you might just put Web.config
(the case of the filename should match the actual filename). If the Web.config
is in a subdirectory, you would include that, for instance, MyApp\Web.config
. If you would like to find and replace any matches for Web.config in all directories/subdirectories, you should be able to use the wildcard syntax **\Web.config.
You should see some lines in the generated task log file mentioning this substitution process taking place, but if things are still not working, these messages may still provide some helpful troubleshooting information.
I’ll also link our baseline documentation for this feature, which includes some additional helpful information for using this functionality, in case it helps at all now or in the future:
If this doesn’t help in resolving things, feel free to temporarily enable variable debugging for this project, create and attempt to deploy a new release, and upload the debug log for me to review in more detail on my side. I will include the process for enabling variable debugging, but let me know if you have any trouble.
Here is a secure link to upload this task log, so you don’t have to post it to the public forum (if needed).
I hope this initial information helps, but let me know how it goes in investigating things more on your side.
Regards,
Britton