Substituion variables in Template

Hi Tema,

I am trying to use Substituion varialbes in Template file feature in my deployment process. I provided the target path with different posibilities (\Web.config, /Web.Config, etc) but seems it could not find the file. the file is a Web.confg file and I have variables defined in the project. The varaibles are defined in Web.config file with #{varname} format. So, two questions, does Substitution variables in template file used to replace variables in web.config file, if so, how do we provide the target path?

Regards,

Endashaw

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

Hi @britton.riggs ,

Issue fixed. thanks. the debugger helped me to find the issue. thank you again

Regards,

Endashaw

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.