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?
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?
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.
I solved it using the Configuration of Connection Strings in the target App Service for my Azure Web App. Within the App startup I use this code to access it, and if running local for debugging it uses the config.json or secrets.json.
Configuration.GetConnectionString("My_ConnectionString_Name");
So you can have your local db mentioned in the secrets.json and set the productive database in the Azure App connection string (if applicable).