Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set connection string in Azure DevOps pipeline

I have some integration tests that I'd like to run against LocalDB.

My config.json file has the following section...

{
  "ConnectionStrings": {
    "DefaultConnection": ""
  }
}

Is it possible to set this value in the build config?

like image 638
Ian Warburton Avatar asked Dec 05 '18 17:12

Ian Warburton


1 Answers

You can achieve this in several ways. Like Powershell scripts to replace the values and ofcourse this replace token extension

You should define your variable like below

{
  "ConnectionStrings": {
    "DefaultConnection": "#{connectstring}#"
  }
}

During the deployment it will get replaced with your actual values.

Refer this SO for more details

like image 184
Jayendran Avatar answered Nov 01 '22 08:11

Jayendran