Skip to content

DefaultDataPath and DefaultLogPath not set #136

Description

  • SqlPackage or DacFx Version:

16.0.6161.0

- .NET Framework : 4.7.1

Steps to Reproduce:

  1. Have a database with memory optimized table in SSDT.
  2. Create a dacpac file via build.
  3. Spin up a new container (any version of SQL)
  4. Try and deploy with DacFx library

Error SQL72014: Framework Microsoft SqlClient Data Provider: Msg 5121, Level 16, State 2, Line 1 The path specified by "USS_Settings_FileGroupMemoryOptimized_203A1A4F.mdf" is not in a valid directory.
Error SQL72045: Script execution error. The executed script:
ALTER DATABASE [$(DatabaseName)]
ADD FILE (NAME = [FileGroupMemoryOptimized_203A1A4F], FILENAME = N'$(DefaultDataPath)$(DefaultFilePrefix)_FileGroupMemoryOptimized_203A1A4F.mdf') TO FILEGROUP [FileGroupMemoryOptimized];

Error SQL72014: Framework Microsoft SqlClient Data Provider: Msg 5009, Level 16, State 14, Line 1 One or more files listed in the statement could not be found or could not be initialized.
Error SQL72045: Script execution error. The executed script:
ALTER DATABASE [$(DatabaseName)]
ADD FILE (NAME = [FileGroupMemoryOptimized_203A1A4F], FILENAME = N'$(DefaultDataPath)$(DefaultFilePrefix)_FileGroupMemoryOptimized_203A1A4F.mdf') TO FILEGROUP [FileGroupMemoryOptimized

The error is because the generate script have the following variables set to empty

:setvar DbEnvironment "Development"
:setvar DefaultDataPath ""
:setvar DefaultLogPath ""

Even when setting them, they are not pulled into the script.

dacDeployOptions.SqlCommandVariableValues.Add("DbEnvironment", "Development");
dacDeployOptions.SqlCommandVariableValues.Add("DefaultDataPath", "/var/opt/mssql/data/");
dacDeployOptions.SqlCommandVariableValues.Add("DefaultLogPath", "/var/opt/mssql/log/");

**Did this occur in prior versions? Yes

DacFx

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions