Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS Release - Define custom variable in web.config and set at release time

I am trying to replace an appSetting at release time using VSTS Release. All post on the web refer to the old release management tool or refer to the new one but mention the replace tokens task. This task does not exist so I presume it is built in. I have set up my web.config (MyVar) and set up my environment variables but nothing gets replaced.

enter image description here

And here is my release: enter image description here

I apologise if I am being stupid but I just can't work this out, mostly due to out of date documentation.

Update 2: Ok so after some help from a couple of people I am now on the right track with this. I have added the Colin's ALM tokenisation task: https://marketplace.visualstudio.com/items?itemName=colinsalmcorner.colinsalmcorner-buildtasks

However, it doesn't work.

Here are a couple of screen shots: enter image description here Note that in the screen shot, I know it is disabled. This is just until I can get it fixed.

In the following screen shot, I see the only a few locations to choose where the tokenisation occurs. Does this look correct or should I be able to see the Web.Config in which I want the tokens to be replaced?

enter image description here

As I said, the tokenisation didnt work.

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

Change 1: Point to a zip file in above acreen shot. My release worked but it had not deployed any of my web site files to the Azure server. NONE, at all.

Change 2: Point to another file CustomerPortal.SetParams.xml

(Note: at this point I was just trying random file to try and get anything to work) My release worked but nothing happened with regard to tokenisation.

Here is part of my log: enter image description here

As you can see, all my files from my website are not there even though the release was successful: enter image description here

enter image description here

Any help would be appreciate.

like image 287
RuSs Avatar asked Feb 25 '16 22:02

RuSs


2 Answers

There is no built-in token replacement in the VSTS Release Management. Injecting values into a web.config is a deployment task, and VSTS Release Management is deployment tool agnostic.

If you need to inject values into configuration files (or otherwise alter them) at the time of deployment, that's something you can build into your deployment scripts.

like image 100
Daniel Mann Avatar answered Sep 30 '22 08:09

Daniel Mann


There is currently no built-in task for replacing token values. You could either write a custom script to handle this or use one of the existing 3rd party task available, like eg the Replace Tokens task Colin's ALM Corner Build & Release Tools .

like image 37
Pascal Berger Avatar answered Sep 30 '22 07:09

Pascal Berger