Skip to content

How to pass variables in post-deployment script #32

Description

@testlab9000

How can I pass a variable in the DACPAC post-deployment script with xDatabase?
For example in the following post-deployment script:
EXEC ('ALTER DATABASE [$(DatabaseName)] MODIFY FILE (NAME = [$(DatabaseName)], SIZE = 100MB, MAXSIZE = UNLIMITED, FILEGROWTH = 20%)');

I can pass $(DatabaseName) by referencing it in

        {
            Ensure = 'Present'
            SqlServer = 'localhost'
            SqlServerVersion = '2014'
            DatabaseName = $DatabaseName
            Credentials = $Credential
            DacPacPath =  'C:\DatabaseTest.dacpac'
            DacPacApplicationName =  $DatabaseName
            DacPacApplicationVersion =  '1.0'
        }

But how can I pass $(databaseSizeSQLCMD) in the following script?
EXEC ('ALTER DATABASE [$(DatabaseName)] MODIFY FILE (NAME = [$(DatabaseName)], SIZE = $(databaseSizeSQLCMD), MAXSIZE = UNLIMITED, FILEGROWTH = 20%)');

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is an enhancement request.help wantedThe issue is up for grabs for anyone in the community.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions