sql server deployments made easy with dacpac
TRANSCRIPT
SQL SERVER DEPLOYMENTSMade easy with DACPACs
Sanil Mhatre@SQLSuperGuru
thank you dev up Conference 2016 Sponsors !
About me
■ Database Solutions Architect in the Financial Services domain
■ Oracle & SQL Server DBA
■ Java , Big Data , C# , SQL Development
■ Speaker
■ Blogger : http://sqlwithsanil.com
■ Twitter : @SQLSuperGuru
Agenda
■ SQL Server Data Tools
■ Legacy deployment scripts
■ What is a DACPAC
■ Benefits of DACPAC Deployments
■ SQLPACKAGE
■ Demos – Physical SQL Server and SQL Azure
■ Q&A
SQL Server Data Tools (SSDT)
■ Modern Database Development tooling
■ Declarative Model
■ Connected or Disconnected Mode of Database Development in Visual Studio
■ Build, Debug, Maintain & Refactor Databases
■ Visual Table Designer
■ Advanced Schema compare & Publish Features
Deployment With Scripts
■ Manual/Custom built
■ Tedious to maintain and deploy
■ Error Prone & susceptible to tampering
■ Static against a target environment
■ Disparate deployment methods
■ Disparate logging techniques
■ Rollback
Data-tier Application Component
■ Data-tier Application Component (DAC)
■ Logical Database Management entity that defines all SQL Sever objects
■ Self contained unit of SQL Server Database Deployment
■ Modern Framework - DacFx
■ Portable Deployment artifact – DAC package (DACPAC, .dacpac file)
DACPAC –What and why
■ DAC Package is a portable deployment artifact
■ Declarative Model, independent of target environment
■ Robust and tamper resistant
■ Ability to perform script-less deployments
■ Works with multiple deployment tools (SqlPackage, MSDeploy, Powershell, etc.)
■ Works with various versions of SQL Server on premise and in the cloud
■ Easy rollback
SQLPACKAGE
■ SqlPackage.exe – command line tool
■ Built into SQL Server & SSMS Install
■ No additional purchase, licensing or install
■ Robust & easy to use
■ Performs all DAC Operations
■ Control deployment options via publish profile and/or Command line parameters
DAC Options/Operations
■ Extract a dacpac (Schema only)
■ Export a bacpac (Schema + Data)
■ Register a DAC
■ Drift Report
■ Demo
DAC Deployments
■ Physical SQL Server – on permise
■ Deployment Report
■ Deployment Script
■ Publish
■ Rollback
■ Demo
DAC Deployments
■ SQL Azure - PaaS
■ Visual Studio Team Services
■ Build definition
■ Release definition
■ Execute Azure SQL : Dacpac Task (SqlPackage.exe)
■ Demo
Summary
■ SSDT
■ DACPAC Deployments
■ Implementation details
■ Benefits
■ Questions ?
Appendix – Build Definition
Appendix – Release Definition
Appendix – Release
Appendix – References
■ SQL Server Data Tools (SSDT) - https://msdn.microsoft.com/en-us/library/hh272686(v=vs.103).aspx
■ DAC Framework (DacFx) - https://msdn.microsoft.com/en-us/library/dn645454(v=sql.120).aspx
■ SQL Package - https://msdn.microsoft.com/library/hh550080(vs.103).aspx#Anchor_5
■ Publish profile with Advanced options -https://blogs.msdn.microsoft.com/ssdt/2015/02/23/new-advanced-publish-options-to-specify-object-types-to-exclude-or-not-drop/
■ Visual Studio Team services - https://www.visualstudio.com/team-services/
■ Build and deploy a DACPAC using VSTS - https://www.visualstudio.com/en-us/docs/release/examples/azure/azure-web-apps-and-sql-db