Q:

TFS variables for connection string

I have continous integration in tfs project. I want to replace connection string to my production db on release, but all the information on the web is confusing. I created parameters.xml with this:
<?xml version="1.0" encoding="utf-8" ?>
<parameters>
  <parameter name="connectionString" description="connectionString" defaultvalue="(localdb)\MSSQLLocalDB;InitialCatalog=BlogsPostsLocalDb;Integrated Security=true;" tags="">
    <parameterentry kind="XmlFile" scope="\\web.config$" match="What to write here?" />
  </parameter>
</parameters>

In TFS, in my App Deploy task I can see SetParameters File option, so I suspect that I have to use that, but I don't understand how to tell it which parameter in Web.config belongs to the parameter in parameters.xml.
In my Web.config I need to replace static path with the one in parameters.xml. My Web.config:
<entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="Data Source=(localdb)\MSSQLLocalDB;InitialCatalog=BlogsPostsLocalDb;Integrated Security=true;" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>

EDIT:
I used a tool to create parameters.xml which now looks like this:
<parameters>
    <parameter name="ConnectionString" description="Description for ConnectionString" defaultvalue="__CONNECTIONSTRING__" tags="">
    <parameterentry kind="XmlFile" scope="\\web.config$" match="/configuration/appSettings/add[@key='ConnectionString']/@value" />
    </parameter>
</parameters>

My web.config:
  <appSettings>
    <add key="ConnectionString" value="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=BlogsPostsTestDb;Integrated Security=True" />
  </appSettings>

And in my context I do this:
public BlogsPostsContext() : base(WebConfigurationManager.AppSettings["ConnectionString"]) { }

In TFS I set variable for relase
Name             | Value
ConnectionString | Data Source=WIN-7ADV5BGRBE3\SQLEXPRESS;Initial Catalog=BlogsPostsDb;Integrated Security=True

Unfortunately when I do a release and look inside web.config on my server I can only see <add key="ConnectionString" value="__CONNECTIONSTRING__" />
And the parameters.xml:
<parameters> 
    <parameter name="ConnectionString" description="Description for ConnectionString" defaultvalue="__CONNECTIONSTRING__" tags="">
    <parameterentry kind="XmlFile" scope="\\web.config$" match="/configuration/appSettings/add[@key='ConnectionString']/@value" />
    </parameter>
</parameters>

MsBuild Arguments:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"

A:

Following articles about parameters.xml mislead me. It turns out that all I had to do to make it work was to follow instructions inside Web.Release.Config. 
This is what I added inside Web.config:
  <connectionStrings>
    <add name="BlogsPostsDb"
         providerName="System.Data.SqlClient"
         connectionString="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=BlogsPostsTestDb;Integrated Security=True"/>
  </connectionStrings>

And this is what I added inside Web.Release.Config:
  <connectionStrings>
    <add name="BlogsPostsDb" 
         connectionString="Data Source=myServerInstance;Initial Catalog=BlogsPostsDb;User ID=*********;Password=******;" 
         xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
  </connectionStrings>

Now it makes sense. As long as the names match in both configs, they will be replaced. I also had to tell my context which connection string I want to use:
public BlogsPostsContext() : base("BlogsPostsDb") { }

