Continuous Deployments using SSDT

Slides:



Advertisements
Similar presentations
Company Confidential 1 © 2005 Nokia DBUpgradeTool_ ppt / / JMa A Database Upgrade Tool Nokia Networks Jukka Maaranen.
Advertisements

Mike Azocar Sr. Developer Technical Specialist Microsoft Corporation
An Intro to ALM Using TFS and Visual Studio for Source Control, Build Automation, Continuous Integration, Deployments, and Task Management.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
USING CI & CD WITH MICROSOFT SQL SERVER Tim Giorgi Senior Software Developer Northwest Evaluation
BizTalk Deployment using Visual Studio Release Management
René Balzano Technology Solution Professional Data Platform Microsoft Switzerland Database Development with SQL Server Data Tools (SSDT)
Improving Software Quality with Continuous Integration
Continuous Integration for Databases Learn how to automate your build and test Steve Jones Red Gate Software Part II of the Continuous Delivery for Databases.
Introduction to Continuous Integration Mike Roberts.
Automating Drupal Deployment Dominique De Cooman.
By John Boal  Continuous Integration [CI] ◦ Automating the build process ◦ Build the entire system each time any new.
Data-tier Application, Import, Refactoring, Publish, Schema Comparison, Database Unit Testing Borislav Statev Telerik Software Academy academy.telerik.com.
Introduction to SharePoint Development with VS2010 Paul Yuknewicz Lead Program Manager
C Copyright © 2009, Oracle. All rights reserved. Using Diagnosis and Debugging Techniques.
@benday #vslive Automated Build, Test & Deploy with TFS, ASP.NET, and SQL Server Benjamin
Database Change Management One solution to an often complex problem Kevin Hurwitz Headspring Systems
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
Continuous DB integration testing with RAT „RATCOIN”
Mirek Sztajno SQL Server Security PM
Isolated Database Environments Kevin Howell February 2014.
Microsoft Ignite /25/ :39 PM SSDT for Visual Studio Bet you can’t tell what your database looked like 6 months ago Hannah Gray, Development.
Database Projects in Visual Studio Improving Reliability & Productivity.
Adxstudio Portals Training
Real World SQL Server Data Tools Benjamin
Build and Deployment Process Understand NCI’s DevOps and continuous integration requirements Understand NCI’s build and distribution requirements.
Visual Studio 2012: A Complete IDE (Debugging & Source Control) Kevin Howell.
Continuous Integration for Databases Steve Jones SQLServerCentral Red Gate Software.
Introduction to SQL Server  Working with MS SQL Server and SQL Server Management Studio.
Continuous Integration and the Data Warehouse Dr. John Tunnicliffe Decision Analytics Independent BI Architect & Hands-On Developer Mobile:
Release Management for Visual Studio 2013 Ana Roje Ivančić Ognjen Bajić Ekobit.
E2G Web Services E2G Scripts and Methods E2G Domain Logic E2G Domain Logic Client Custom Scripts and Methods Client Custom Scripts and Methods E2G Rules.
Continuous Integration and the Data Warehouse Dr. John Tunnicliffe Independent BI Architect & Hands-On Developer Mobile:
Others Talk, We Listen. Managing Database Projects in Visual Studio 2013.
Continuous Integration for Databases Steve Jones SQLServerCentral Red Gate Software.
SQL Database Management
Automated Build and Test
SSIS Templates, Configurations & Variables
ASP.NET Programming with C# and SQL Server First Edition
Stress Free Deployments with Octopus Deploy
Launch Your Database Into Microsoft Azure
Visual Studio Database Tools (aka SQL Server Data Tools)
Agile Analytics: Automated Builds and Deployments
SQL Server deployments
Continuous Integration and the Data Warehouse
Continuous Deployments using SSDT
Database version control
Database version control
Deploying and Configuring SSIS Packages
DEA Will Be Your New Best Friend!
Introducing New Team-based Data Integration with SSIS
Bringing DevOps to the Database
SQL Server Data Tools Gert Drapers
Continuous Integration For Databases
Prove to your boss your database is sound - Unit Testing with tSQLt
Launch Your Database Into Azure
Continuous Deployments using SSDT
Bringing DevOps to the Database
Continuous Deployments using SSDT
Quality Assurance in an Agile Development Team Michelle Wu 2018 PNSQC
Continuous Deployments using SSDT
DAT381 Team Development with SQL Server 2005
Presented by : Chirag Dani & Dhaval Shah
SSDT and Database Project Basics
What about the Data Dude?
Database version control
SSDT, Docker, and (Azure) DevOps
SSDT, Docker, and (Azure) DevOps
SSDT, Docker, and (Azure) DevOps
Samir Behara, Senior Developer, EBSCO
Presentation transcript:

Continuous Deployments using SSDT How I Learned to Stop Worrying and Love the DACPAC

Who am I? Christopher Wolff Twitter: @tickytong Email: tickytong@gmail.com Blog: http://sqlred.blogspot.com/

Objectives Continuous Deployments Of DACPACs and Publish Profiles SqlPackage.exe and you! Using your tools Automation Nation Questions?

Assumptions Basic knowledge of SQL Server Data Tools for Visual Studio (SSDT) Basic knowledge of XML for Publish Profile manipulation Basic knowledge of how a relational database schema works Specifically Microsoft SQL Server in this case

Continuous Deployments Synergizing synergies

Why Continuous Deployments? To cut down on the amount of code in each release Makes sprints shorter and is easier to troubleshoot issues on release Give development team ownership of there own releases Take Ops out of the way so if issues arise, the development team can troubleshoot the issue first and then use Ops as a last resort Catch issues earlier in the process Testing is done constantly during development instead of at the end so fixes are done right away instead of waiting for the next sprint

Steps for Continuous Integration Every developer will have a version of the DB on there own machine In order for them to have ownership, they must test it themselves It’s also good to do pull requests so the fellow developers can check each others work When they are complete with their individual tasks they check the SSDT project into a source control system Github or Team Foundation Server A deployment manager or project manager will typically make an integration branch in the source control This is for teams to commit their finished code to before the release happens Typically this will also deploy to a Stage environment so that QA can do further testing Once a release has been declared, the manager will make a release branch All changes will then be merged to this branch in preparation for the release to Prod

On to Continuous Deployment Once all code has been merged deploy the code to a testing environment Often called Livestage or just Test It will contain a recent version of a prod backup to test against live data QA’s commences testing This usually happens a week before release so QA can flesh out any issues Release to Live

Of DACPACs and Publish Profiles Tools of the trade

DACPACs Data Tier Applications Contains all the schema information in any one database Gives a single entity for deploying changes to a production or test database As apposed to multiple SQL scripts Can also include security credentials if needed Idempotent so they will never rerun code, just the code that is missing A close relative is the BACPAC which contains all the data in the database along with the schema information

Publish Profiles A collection of all the property key-value pairs that are used by the DACPAC as settings when deploying to a target database Include properties like: Database name Connection string SQLCMD variables How to handle change data capture (CDC) and replication All of these properties come from SqlPackage.exe

SqlPackage.exe and you! The one .exe to rule them all

SqlPackage.exe A command line tool provided by SQL Server that automates extraction, exporting, importing, publishing, and scripting of a database It is automatically installed with every version of SQL Server Usually stored in C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin Built in parameters that switch on or off the property of the deployment Examples /p:IgnorePermissions={True | False} - Specifies whether permissions should be ignored during deployment. /p:DoNotAlterChangeDataCaptureObjects={True | False} - If true, Change Data Capture objects are not altered during deployment. /p:DropObjectsNotInSource={True | False} - Specifies whether objects that do not exist in the database snapshot (.dacpac) file will be dropped from the target database when you publish to a database.

Using your tools How to do the needful

Basic Setup Have a deployment server to dispatch the code from Typically called a terminal server Have the dacpac and published profile checked into a versioning system Such as Github or Team Foundation Server Using SQLPackage.exe, execute a command line script to publish the dacapac and publish profile to the server Example "C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe" /a:Publish /TargetConnectionString:"application name=DBDeployment;data source=MyProdDB;initial catalog=MyProdDB;Integrated Security=True" /SourceFile:"C:\Deployment\Input\1.0\MyProdDB\MyProdDB.Database.dacpac" /pr:"C:\Deployment\Input\1.0\MyProdDB\MyProdDB.Database.publish.xml“ When you execute the scripts it will print a log file to the screen of what was actually executed in the dacpac Optionally you can have it output to a log file instead > "C:\Deployment\Output\1.0\MyProdDB\01012015_0700_MyProdDB_1_0.log"

DEMO

Making your job easier, one script at a time Automation Nation Making your job easier, one script at a time

Why Automate? Consistency Less Errors Speed and Ease of Use Using the same release process every time will cut down on errors Less Errors Makes it easier to troubleshoot and quicker to recognize where the errors occur Speed and Ease of Use Single call to execute the release as apposed to running multiple scripts

Automation Tools Source Control Continuous Integration Software GitHub TFS Continuous Integration Software TeamCity Jenkins Bamboo Octopus Deploy Scripting software PowerShell Ruby Bash Cmd Line

Steps to Automate Check in Release Check for New Release Usually through a release branch in the source control software Check for New Release The CI software can be used to look for new releases in source control or have a release manager initiate the release through the CI software Run the Release The CI software will then run the predesigned script to deploy the release

Questions? Comments? Crude remarks?

Credits Data-tier Application Overview https://msdn.microsoft.com/en-us/library/vstudio/ee362011%28v=vs.100%29.aspx Publish Profile Files in SQL Server Data Tools (SSDT) http://sqlblog.com/blogs/jamie_thomson/archive/2012/05/09/publish-profile- files-in-sql-server-data-tools-ssdt.aspx SqlPackage.exe https://msdn.microsoft.com/library/hh550080.aspx Deploying a DACPAC with SqlPackage http://blogs.msmvps.com/deborahk/deploying-a-dacpac-with-sqlpackage