I have a dacpac file which I am deploying via an application using the DacServices library. I have the following code to do it:
var dp = DacPackage.Load(dacpacPath);
var dbDeployOptions = new DacDeployOptions
{
BlockOnPossibleDataLoss = false
};
var dbServices = new DacServices(WebConfigHelper.GetDbConnectionString(webConfigPath));
dbServices.Deploy(dp, WebConfigHelper.GetDbName(webConfigPath), true, dbDeployOptions);
The issue is that with this code, the target database always has it's recovery model altered to "Full" which is what is set in the SSDT database project (which generates the dacpac).
The various target databases which we deploy to use a variety of database properties, and we don't know the target DBs recovery model. Some use simple, and some use full - we don't want to change it.
How can I alter this code so that it doesn't make any alterations to the target database properties? I have already tried unticking the "Deploy database properties" setting in the database project, but the above code seems to override that.