The environment:
- Using a SQL Server Database Tool in Visual Studio 2013, Update 4 to create a DacPac for publishing a database.
- Using TFS build to build and drop the database project.
- Using SqlPackage version to publish the dacpac to SQL Server 2012.
Using the SqlPackage Action "Publish", the script for deployment is generated using the following variables based on the target database's defaults:
:setvar DefaultDataPath "H:\YourServerDefault"
:setvar DefaultLogPath "H:\YourServerDefault"
I would like to override these locations to land in a specific pair of directories where we have some external encryption configured.
I have attempted to override these SQLCMD values in a couple ways:
Override on the command line:
SQLPackage /Action:Publish /SourceFile:./Db.dacpac /Profile:./MyProfile.publish.xml /Variables:DefaultDataPath=H:\MyNewLocation
Add an override in the publish profile (snippet below):
<ItemGroup>
<SqlCmdVariable Include="DefaultDataPath ">
<Value>H:\YourServerDefault</Value>
</SqlCmdVariable>
</ItemGroup>
While I can use either technique to override my own defined SQLCMD variables, the built in ones like DefaultDataPath and DefaultLogPath are ignored.
Is there a way to override these values when publishing with SqlPackage?