using .net 4.0 Sql Server 2008 R2 I am trying to use dbDacFx provider to deploy my dacpac file. This database project uses a variable named UserName to create logins and users etc. Value for this needs to be passed during deployment time.
So i tried this
msdeploy.exe -verbose -verb:sync -Source:dbDacFx="c:\dev\project\Build\database\Database.dacpac" -dest:dbDacFx="Data Source=localhost;Integrated Security=True;Database=UIConfig" -setParam:type=SqlCommandVariable,scope=Database.dacpac,match=UserName,value="IISAppPool\ASP.NET V4.0"
and i get following error
Verbose: Performing synchronization pass #1.
Verbose: No backup was executed. Info:
Adding MSDeploy.dbDacFx (MSDeploy.dbDacFx).
Info: Adding database (data source=localhost;integrated security=True;database=U IConfig)
Info: Creating deployment plan: Pending.
Info: Verifying deployment plan: Pending.
Info: Deploying package to database: Pending.
Info: Creating deployment plan: Running.
Info: Initializing deployment (Start)
Info: Initializing deployment (Failed)
Info: Creating deployment plan: Faulted.
Info: Verifying deployment plan: Faulted. Info: Deploying package to database: Faulted. Error Code: ERROR_EXECUTING_METHOD More Information: Could not deploy package. Missing values for the following SqlCmd variables:UserName. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXECUTING_M ETHOD.
Error: Could not deploy package. Error: Missing values for the following SqlCmd variables:UserName. Error count: 1.
how can i pass a variable value at deployment time ? many thanks