Reputation: 14088
I'm looking at ways to automatically publish a dacpac whenever I deploy my web application to IIS.
One of those ways is through Web Deploy itself, using the dbDacFx provider. See: http://www.iis.net/learn/publish/using-web-deploy/dbdacfx-provider-for-incremental-database-publishing
Some of the examples that they give for syncing two databases look like this:
msdeloy.exe -Verb:Sync ^
-Source:dbDacFx="Data Source=.\SQLEXPRESS; Database=OldDatabase; User ID=sa; Password=P@$$W0rd" ^
-Dest:dbDacFx="Data Source=.\SQLEXPRESS; Database=NewDatabase; User ID=sa; Password=P@$$W0rd"
msdeloy.exe -Verb:Sync ^
-Source:dbDacFx="C:\Users\Admininstrator\Documents\database.dacpac" ^
-Dest:dbDacFx="Data Source=.\SQLEXPRESS; Database=NewDatabase; User ID=sa; Password=P@$$W0rd"
My question is why on earth would I not use SqlPackage.exe for this?
SqlPackage.exe /Action:Publish ^
/SourceConnectionString:"Data Source=.\SQLEXPRESS; Database=OldDatabase; User ID=sa; Password=P@$$W0rd" ^
/TargetConnectionString:"Data Source=.\SQLEXPRESS; Database=NewDatabase; User ID=sa; Password=P@$$W0rd"
SqlPackage.exe /Action:Publish ^
/SourceFile:"C:\Users\Admininstrator\Documents\database.dacpac" ^
/TargetConnectionString:"Data Source=.\SQLEXPRESS; Database=NewDatabase; User ID=sa; Password=P@$$W0rd"
Web Deploy doesn't bring anything new to the table as far as I can tell. Why does the dbDacFx provider even exist?
Things I already considered:
Upvotes: 1
Views: 721
Reputation: 6856
I guess the only way you will get a definite answer as to why it exists is to find someone on the msdeploy team and ask them.
The thing that is so awesome about dacpacs is that the SSDT team have built these api's (DacFX) and made them available to everyone so people are free to do this sort of thing and if it helps people who already use msdeploy deploy dacpacs then why not?
I have seen a few different implementations, visual studio has publish + schema compare which both use the DacFx.
If you already use sqlpackage and want to use it go for it.
Upvotes: 1