Azure Dev ops replace tokens per environment in release pipeline

15,382

Release activities run on the release agent. You're running token replacement after the application is deployed to the app service, so the token replacement isn't getting deployed.

That's one issue.

Another issue is that web deploy packages are zip archives, so token replacement isn't going to affect the files contained in the zip file. You shouldn't use token replacement in conjunction with web deploy. You should use web deploy transforms (parameters.xml and SetParameters.xml), which are supported by the web deploy task that you're using. parameters.xml allows you to define xpath expressions for locating elements to transform, and the setparameters.xml files contain the values to use in the transformation.

Share:
15,382
SitecoreNoob
Author by

SitecoreNoob

Updated on June 21, 2022

Comments

  • SitecoreNoob
    SitecoreNoob almost 2 years

    i am using the Replace token extension https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens to replace variable in **/*.config files

    Our build pipeline creates one artifact that needs to be deployed to all environments

    we have 2 environments in our release pipeline(DEV ,QA)

    Each environment has a set of variables configured

    enter image description here

    I have added the replace token task onto our release pipeline

    enter image description here

    My config files looks like this

    enter image description here

    The the tokens are not replaces , i Am new to Azure DevOps , am i missing anything here?

  • thatWiseGuy
    thatWiseGuy over 4 years
    This works for a Windows app service but not Linux. For Linux app services, I don't even see the "File Transforms & Variable Substitution Options" section in the web deploy task. Any idea why, or how I can replace tokens for Linux? This seems very basic...