18
SQL SERVER DEPLOYMENTS Made easy with DACPACs Sanil Mhatre @SQLSuperGuru

SQL Server Deployments made easy with DACPAC

Embed Size (px)

Citation preview

Page 1: SQL Server Deployments made easy with DACPAC

SQL SERVER DEPLOYMENTSMade easy with DACPACs

Sanil Mhatre@SQLSuperGuru

Page 2: SQL Server Deployments made easy with DACPAC

thank you dev up Conference 2016 Sponsors !

Page 3: SQL Server Deployments made easy with DACPAC

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

Page 4: SQL Server Deployments made easy with DACPAC

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

Page 5: SQL Server Deployments made easy with DACPAC

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

Page 6: SQL Server Deployments made easy with DACPAC

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

Page 7: SQL Server Deployments made easy with DACPAC

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)

Page 8: SQL Server Deployments made easy with DACPAC

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

Page 9: SQL Server Deployments made easy with DACPAC

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

Page 10: SQL Server Deployments made easy with DACPAC

DAC Options/Operations

■ Extract a dacpac (Schema only)

■ Export a bacpac (Schema + Data)

■ Register a DAC

■ Drift Report

■ Demo

Page 11: SQL Server Deployments made easy with DACPAC

DAC Deployments

■ Physical SQL Server – on permise

■ Deployment Report

■ Deployment Script

■ Publish

■ Rollback

■ Demo

Page 12: SQL Server Deployments made easy with DACPAC

DAC Deployments

■ SQL Azure - PaaS

■ Visual Studio Team Services

■ Build definition

■ Release definition

■ Execute Azure SQL : Dacpac Task (SqlPackage.exe)

■ Demo

Page 13: SQL Server Deployments made easy with DACPAC

Summary

■ SSDT

■ DACPAC Deployments

■ Implementation details

■ Benefits

■ Questions ?

Page 14: SQL Server Deployments made easy with DACPAC
Page 15: SQL Server Deployments made easy with DACPAC

Appendix – Build Definition

Page 16: SQL Server Deployments made easy with DACPAC

Appendix – Release Definition

Page 17: SQL Server Deployments made easy with DACPAC

Appendix – Release

Page 18: SQL Server Deployments made easy with DACPAC

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