Substitute variable in transform files not working

HI All,

I’m having some difficulty getting some variables replaced in my web.config transformation file.
I have the following section on my web.config file. I’m replacing this with a config transform file.

Would be grateful for any help

Kind regards
Sha

Hi Sha,

Thanks for getting in touch! I appreciate you providing that information to help out. Unfortunately I’m currently unable to determine for sure what could be causing these variables to not be substituted, but I would check a couple things.

Do you have the Substitute variables in files feature enabled?
Are you targeting the web.Dev.config file in the Target files section on your package step? Since substitution are done before transforms (as outlined in our package deployment feature ordering doc page), you would need to target the transform file instead of the web.config file.

If you have it set up like this, would you be willing to provide a copy of your verbose deployment logs with debugging variables enabled to shed more light on what’s going on exactly? The following doc page outlines how you can produce and export this log. (If the logs have sensitive information, feel free to mark this conversation as private, or send the logs to support at octopus dot com and I can get it there.)

I look forward to hearing back!

Kind regards,

Kenny

HI Kenny,

Thanks for the for response. I have emailed the logs and some of the screenshots. Please let me know if you require further information.

Kind regards
Shaluka

Hi Shaluka,

Thank you for following up and providing that information via email. I’ve received them and responded to your email. We can continue the investigation there. :slight_smile:

Best regards,

Kenny

HI Kenny,

Thanks a lot for for the info and pointing out what was missing. I’ll add your response here so it may help someone in the future. The issues was I hadn’t defined which files the veriavles should apply to.

Hi Shaluka,

You’re very welcome, and thanks for following up with that additional information!

Your logs indicate that the Substitute variables in files feature is enabled, but it’s not performing substitution on any file. It would show something like this: Performing variable substitution on ‘Path\web.Dev.config’

I suspect that this file hasn’t been defined in the Target files field of this feature, as shown in the following screenshot.

Octopus_TargetFiles_Field

Can you confirm if you’ve configured your step in this way? Note you’ll have to create a new release to apply any changes to variables or deployment process.

I hope this helps for now! Let me know how you go, and if you have any further questions, don’t hesitate to reach out.

Best regards,

Hi Shaluka,

You’re very welcome, and that’s great to hear we’ve figured out the missing piece! Thanks for letting me know, and please don’t hesitate to reach out if you have any questions or concerns in the future. :slight_smile:

Best regards,

Kenny

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