I'd like to reference variables I've defined in my deployment project (scoped to an environment) from my web.config.[environment] transform files. When I do, the variable references end up in the transformed web.config without being replaced.
How can I have Octopus do variable substitution during or after applying a configuration transform?
7k Views Asked by Jim Lamb At
2
There are 2 best solutions below
0
Erik A. Brandstadmoen
On
This changes from Octopus 2.3 to 2.4. Variable substitution is now performed before XML transforms are run. See here for more details: https://github.com/OctopusDeploy/Issues/issues/827
Related Questions in CONFIGURATION
- Logback stopped logging after splitting shared config file
- Understanding Grizzly 1.9.36 internals
- Symfony 2 and php.yml configuration
- Tree configuration to turn on/off the features in java
- Deleting Repeated Services from Android GCM Config File
- What does the dot mean in Symfony service names?
- How to manage configuration data in large projects?
- org.apache.commons.configuration.INIConfiguration: section name with dot (period)
- How to include js files in a Visual Studio project on build
- What is the correct way to use app.config for my plugin when using MEF?
- How run several instances of GWT application in IntelliJIDEA
- ejabberd block messages from users that don't stay in my friend list
- CMake error while configuring "install TARGETS given no RUNTIME DESTINATION for executable target "assimp_simpletexturedogl"."
- Need help in configuring Jenkins with Coverity. Getting Error Message
- How do I access the service provider when registering using typescript class
Related Questions in OCTOPUS-DEPLOY
- TFS 2013 with Octopus Deploy, Email Template - Resolved Bugs/User Stories
- Octopack for .Net 2.0 and msbuild 2.0
- Octopack is not packing when using custom nuspec file
- TFS Build tag git branch with build number
- Add Binding To IIS With PowerShell Without Overwriting Existing
- Does Octopus Deploy talk to any other repos ( like maven, npm) other than nuGet?
- configuring click once app in Octopus deploy with mage.exe, change publish url and app.config
- Is there a way to package an ASP.NET Core app, using NuGet or otherwise?
- How do I add the job status (success or failure) in the email notification?
- How to build single nuget package for multiple projects in a solution
- Octopus Deploy uses a snapshot of deployment until I create a new release
- Powershell job with alternate credentials from Octopus Deploy
- SQLite.Interop.dll not getting picked up by OctoPack
- OctoPack for deployment packaging all web.config files
- TFS build definition associated commits
Related Questions in VARIABLE-SUBSTITUTION
- Does R support indirect variable expansion or variable substitution?
- Bash: Insert variable content into command substitution as arguments - how to quote correctly?
- Dotnet framework - Nlog configuration change using variable substitution in TFS cd pipeline
- How to avoid variable substitution in Perl regex?
- $_SESSION[] inside of Double quotation
- Django variable substitution in the include template tag
- Azure DevOps Pipeline Json Variable Substitution - Ocelot.json
- Substituting variable in a dataframe row based on other row's value
- Getting a count of rows inserted in a Snowflake procedure
- Ruby variable subsitution in method call
- Azure DevOps Pipeline Json Variable Substitution - Microsoft.Hosting.Lifetime
- ##[error]Error: NO JSON file matched with specific pattern: **/appsettings.json
- Embedded parameter substitution
- Xml Transformation and Variable substitution doesn't work when both selected in Azure DevOps
- How can I have Octopus do variable substitution during or after applying a configuration transform?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I eventually figured this out, through trial and error, so I'll share my experience here. If you want to substitute variables in configuration files at deploy time, you can do it with the current (>= 2.4.*) version of Octopus Deploy. Here are the steps I used when configuring the deployment step:
Click "Configure features" and turn on the "Substitute variables in files" option.
In the "Substitute variables in files" section that this adds, specify your target files. For me, this was "Web.#{Octopus.Environment.Name}.config". You don't have to specify a relative path, Octopus will find them wherever they are in your source tree.
That should do it. It would be nice if these configuration options were visually grouped in the user interface so that it was more obvious that they were dependent on one another.