VSTS Release - defining a user variable in web.config and setting the release time

I am trying to replace appSetting during release using VSTS Release. All messages on the Internet refer to the old release management tool or refer to the new one, but mention the task of replacing tokens. This task does not exist, so I assume that it is built-in. I installed my web.config ( MyVar ) and set up the environment variables, but did not replace anything.

enter image description here

And here is my release: enter image description here

I apologize if I'm stupid, but I just can't solve it, mainly due to outdated documentation.

Update 2: Good, so after some help from a few people, I am now on the right track with this. I added the Colken ALM tokenisation task: https://marketplace.visualstudio.com/items?itemName=colinsalmcorner.colinsalmcorner-buildtasks

However, this will not work.

Here are some screenshots: enter image description here Please note that in the screenshot I know that it is disabled. This only happens until I can eliminate it.

In the next screenshot, I see only a few places where you can choose where tokenization occurs. Does this look right or should I see Web.Config in which I want to replace tokens?

enter image description here

As I said, tokenization does not work.

I tried a couple of changes to try to get it to work.

Edit 1: Hover over the zip file above. My release worked, but it did not deploy any of my website files on an Azure server. NONE, generally.

Edit 2: Specify a different CustomerPortal.SetParams.xml file

(Note: at this point I was just trying to use a random file to try to get everything to work) My release worked, but nothing happened regarding tokenization.

Here is part of my journal: enter image description here

As you can see, all my files from my site are missing, although the release was successful: enter image description here

enter image description here

Any help would be appreciated.

+7
release-management ms-release-management
source share
3 answers

This can be tricky if you come from old versioning or Web Deploy tasks that replace tokens from Web.Release.config and replace strings in your regular web.config.

The solution I completed consists in using two tasks; one task is to replace Web.Release.config tokens (and not web.config, because I want to run locally without problems), and the second task is to move the Web.Release.config file through your web.config. I am on Windows servers, so your implementation may need to be configured, but the process will be similar.

IMPORTANT Your Web.Release.config should be a complete clone of your web.config, with tokens in place. It cannot remain a partial configuration, as it could be when using the old web deployment transform function.

Using cmd.exe, the arguments are: cmd / c move / y "YOUR_BUILD \ drop \ YOUR_PROJECT \ Web.Release.config" "YOUR_BUILD \ drop \ YOUR_PROJECT \ Web.config"

enter image description here

enter image description here

+2
source share

There is no built-in token replacement in VSTS Release Management. Embedding values ​​in web.config is a deployment task, and VSTS Release Management is an agnostic for deployment.

If you need to enter values ​​in configuration files (or otherwise modify them) during deployment, this is something you can embed in your deployment scripts.

+4
source share

There is currently no built-in task to replace token values. You can write a custom script to handle this, or use one of the existing third-party tasks, for example, for example, the Replace Tokens Colin ALM Corner Build task and Release Tools .

+4
source share

All Articles