Config Transform in Octopus deployment not working correctly

support

(Ofer) #1

Hey

ENV:
Deploy to Azure Web App
Octopus version: 2018.8.4

Need to figure out why Config Transform in Octopus deployment not working correctly, The result don’t contain the “/” in the end of the url.

Here is the web.config: (Some how, in this post, if line start with “<”, it not shown at all :slight_smile: )
appSettings>
add key=“WebApiUrlRoot” value=“https://a1a1a1.domain.co.il/” />
appSettings>

web.dev.config:
appSettings>
add key=“WebApiUrlRoot” value=“https://aaa.domain.co.il/” xdt:Transform=“SetAttributes” xdt:Locator=“Match(key)” />
/appSettings>

Result:
add key=“WebApiUrlRoot” value=“https://a1a1a1.domain.co.il” /> # No “/” in the end of the url

Octopus Log:

Transforming ‘C:\Octopus\Work\20181010121033-11660-9953\staging\Web.config’ using ‘C:\Octopus\Work\20181010121033-11660-9953\staging\Web.Dev.config’.
Warning will be elevated to errors. Prevent this by adding the variable Octopus.Action.Package.TreatConfigTransformationWarningsAsErrors and setting it to false.
Executing SetAttributes (transform line 18, 75)
on /configuration/appSettings/add[@key=‘WebApiUrlRoot’]
Applying to ‘add’ element (source line 8, 6)
Set ‘key’ attribute
Set ‘value’ attribute
Set 2 attributes
Done executing SetAttributes


(Ofer) #2

Solve it:
Duplicate Variable int Variable transform

Thanks


(Kenneth Bates) #4

Hi Ofer,

Thanks for getting in touch! That’s great to hear you’ve found the solution - thanks for letting us know. Don’t hesitate to reach out if you have any other questions or concerns in the future. :slight_smile:

Best regards,

Kenny


(system) #5

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