solidify / vsts-task-tokenize-in-archive

VSTS build and release task to replace tokens in an archive file
5 stars 3 forks source link

Support for variables with different names than the token? #10

Open VictorioBerra opened 4 years ago

VictorioBerra commented 4 years ago

I know this is not an easy request, but its been a non-starter for me for most token replace tasks I have found except this one: https://marketplace.visualstudio.com/items?itemName=citrus-andriessen.cag-replace-tokens

My use case:

I tokenize my Web.Config in my DevOps Release Pipelines depending on what environment I am deploying to. (Dev, Test or Prod). My variables are a linked variable group from the DevOps library, which uses the new KeyVault feature.

The issue here is 2 things:

  1. The main one is my Web.Config might have @@hello-world@@ but my KeyVault has HelloWorld and that can not be changed because in the variable group in the library, it takes the name of the KeyVault secret name, and then when you link the variable group in the release pipeline you are stuck with that name. So the only way to change the name is to change the name of the KeyVault Secret name to match the Web.Config token and that just seems like bad practice. The other option is to to change the token name in the Web.Config. It seems like the lesser evil but why should I have to modify code to make a task/pipeline happy?

  2. my KeyVault also pulls down deployment related variables, so I don't want this task scooping up all my release variables and trying to shove them places. I love the explicit nature of the ReplaceTokens task by Citrus as linked above.

Like I said I have this issue with every single token task except the above one but the above one doesn't let me tap into a zip file.