DevOps CI and Data Warehouse
DevOps CI and Data Warehouse
John Tunnicliffe
devops-your-dwh.com
john@bovi.co.uk
M: +447771818770
Data Warehouse
Agenda
What is DevOps?
SQL Server Data Tools (SSDT)
SSDT Unit Tests
PowerShell and psake build tools
Azure DevOps
Octopus Deploy
What is Continuous Integration?
Continuous Integration is a development practice that requires developers to
integrate code into a shared repository several times a day.
Improve stability
Deploy
Use SQLPackage.exe to deploy each DACPAC using a DAC Publish Profile
Tools and techniques for DevOps
SSIS Artifacts
Build
MsBuild generates an ISPAC => “deployable artifact”
Deploy
Use IsDeploymentWizard.exe to deploy the ISPAC
Finish configuration by running SQLCmd scripts from PowerShell that use SSISDB
catalog stored procedures to:
▪ Create Projects & Folders
▪ Create Environments & Variables
▪ Associate Environment with Project
SSISDB deployment script from https://www.hansmichiels.com/2016/11/04/
Tools and techniques for DevOps
SSAS Artifacts
Build
MsBuild generates a .AsDatabase file => “deployable artifact”
Deploy
Microsoft.AnalysisServices.Deployment.exe /s
Use PowerShell to alter XML config files defining target server etc.
▪ Top Tip: Windows EXE => so pipe to Out-Null to force PowerShell to wait
Tools and techniques for DevOps
SSRS Artifacts
Build
Does nothing useful! => simply copies RDL files to a sub-directory
Deploy
1. SSRS web service – ReportService2005.asmx?WSDL
Problematic and unreliable
2. Use Visual Studio command-line (devenv.exe)
Problematic and unreliable
3. REST APIs for SQL Server 2017 Reporting Services
No examples and I have not had chance to try yet
Tools and techniques for DevOps
Source Code Control (SCC)
ALL code MUST be under Source Code Control
SQL Server, SSIS, BIML, SSAS, SSRS, Test Suites etc. etc.
Recommend Using Three Branches
1. Development branch
2. Release branch
3. Prod branch
SCC Locking strategy:
Use optimistic locking for SQL, C#, BIML
Use pessimistic locking for SSIS, SSAS, SSRS and PowerBI
PowerShell
PowerShell is the “glue” for your CI project
Part of Windows Management Framework
Advanced scripting
Proper error handling Try-Catch
Easy to read/write XML
Ideal for reading and writing config files
Easy to read/write CSV
Great for iteration
SQL specific CmdLets
Invoke-SQLCmd
Invoke-ASCmd & SQLAS
psake
Task-orientated build tool written in PowerShell
Uses a dependency pattern similar to MSBuild or Make
Download from https://github.com/psake/psake
Build script consist of Tasks
Each task can depend on other tasks
Tools and techniques for CI
psake
Octopus Deploy
Octopus Server
Database and Web App
Octopus Tentacle
on each target server
https://github.com/DrJohnT/devops-your-dwh
Blog: https://devops-your-dwh.com
Agenda Recap
What is DevOps?
SQL Server Data Tools (SSDT)
SSDT Unit Tests
PowerShell and psake build tools
Azure DevOps
Octopus Deploy
Dr. John Tunnicliffe
devops-your-dwh.com
john@bovi.co.uk
M: +447771818770
Data Warehouse