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
- Ubuntu wsl2 in windows, my /etc/fonts/fonts.conf keeps reloading
- I am trying to run java application in Eclipse, When I try to do Run > Run as > Java Application it starts to show little processing but nothing happe
- CISCO refuses to turn off spanning tree for specific vlans
- Resolve paths dynamically based on directory where test (or tested files) is located in Jest
- `android` Does Not Exist in `~/Android/Sdk/platform-tools`
- jboss configuration via ipv6 version jboss-eap-7.4
- I can't find a conenction diagarm for the OV7670 camera to the ESP8266
- Locally testing OS environmental variables in Ballerina
- Why is the build configuration always choosing production?
- App Configuration affecting VS Web Server Hosting
- IServiceCollectionConfigurator' does not contain a definition for 'UsingRabbitMq'
- Localhost Not Working After Creating Virtual Host in XAMPP
- Why am i unable to download MySql?
- Azure App Configuration - Replica for 429 HTTP responses
- TYPO3: tx-form custom fluid templates and class for submit button
Related Questions in OCTOPUS-DEPLOY
- Linked variables in Octopus
- Octopus Deploy Dynamic Infrasture at Project Level
- Can Octopus Deploy choose an unused environment?
- Unable to create release in Octopus Deploy using GitHub Actions
- Building specific project in a solution using Azure devops without yaml
- How to retrieve deployment targets id's in Octopus
- How do I use PowerShell Core with the "Deploy an Azure App Service" Octopus step?
- is there a way to parse sql files before they are executed in dbup using octopus deploy?
- Octopus Deploy: no matching targets were found
- Access Octopus Deploy variables scoped with `Octopus.Deployment` in Python
- octopus-deploy *.ocl configuration files upload to another octopus server
- OctopusRepository is returning everything as empty
- Deploy multiple projects at a time in one click using Octopus
- Set Octopus output variable from sql script
- Deploying an ARM Template for Ocotpus Deploy
Related Questions in VARIABLE-SUBSTITUTION
- File-transform-task in Azure DevOps release-pipeline not substituting variables
- Solved: How do i loop through arrays using variable expansion on strings in batch?
- Makefile: Substituting suffix of variable before evaluation
- Variable substitution: How to update values in a json file and then save the output of the now substituted file
- Can a Gnu Make variable substitution expression match more than one pattern?
- Editing TXT file content using a wildcard
- Environment variables substitution in C
- Excel Summing Un-Formatted Numbers
- Call a .NET method with part of the method name replaced by a variable
- How to add variables in a call to Start-Process
- Azure DevOps Pipeline Json Variable Substitution - Ocelot.json
- Passing variables from bash script into Oracle SQL*Plus
- Embedded parameter substitution
- Getting a count of rows inserted in a Snowflake procedure
- Substituting variable in a dataframe row based on other row's value
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 # Hahtags
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.