qetza / replacetokens-task

Azure Pipelines task to replace tokens in files with variables.
MIT License
11 stars 2 forks source link

How to replace token in development environment #48

Open stetou opened 1 month ago

stetou commented 1 month ago

We do have TESTS that runs on a database project. The connectionString is in the app.config file I plan to use your extension to create a token and replace it during deployment with a pipeline. But how do we replace the token in how local development environment, means while executing the TEST in Visual Studio ?

qetza commented 2 weeks ago

Hi @stetou,

  1. you could have 2 files, one for local development with your connection string and one for deployment with your token but this means make sure the they are synchronized when you add/remove a parameter.
  2. if your app.config is an xml file you could use xdt transforms during your deployment to inject the tokens in the app.config and then do a token replace