Download presentation
Presentation is loading. Please wait.
Published byJocelyn Potter Modified over 6 years ago
1
Agile Analytics: Automated Builds and Deployments
Mike Diehl | Practice Lead, Databases and Business Intelligence Winnipeg , Calgary, Dallas, and everywhere!
2
Please Support Our Sponsors
SQL Saturday is made possible with the generous support of these sponsors. You can support them by opting-in and visiting them in the sponsor area.
3
Don’t forget to silence your phone
4
Post Con
5
Before Agile… Chaos? Waterfall? Big design up front (BDUF)
6
Dev, Test, Prod – hard to synchronize
Where are you? Dev, Test, Prod – hard to synchronize No source code control for database/BI assets Hard to control quality of Change scripts Fear of Change Chaos/Paralysis
7
What is Agile? Value-driven development Production Quality
Iterative, incremental, evolutionary Minimize ceremony Just In Time Design Repeatable (and automatable) processes Collaboration
8
Agile Analytics http://theagilist.com/
Ken Collier, author of “Agile Analytics: A Value-Driven Approach to Business Intelligence and Data Warehousing”
9
Business Intelligence Assets
SQL Database project(s) SQL Analysis Database project(s) SQL Integration Services project(s) SQL Reporting Server project(s)
10
Source Code Control Declarative Project Model
The source code defines “how you want it”, not “how you change it” Source Code Control provides historical change records A target database is updated at deployment by determining what changes are required to make it match the compiled project You can o
11
Tools Visual Studio 2015 SQL Server Data Tools (SSDT) SQL Server 2016
SQL Management Studio Visual Studio Team Services Free for five users
12
Agile Development Cycle
Developer Code Compile Test Check In Build Agent Build (Test) Release
13
Build Environment VSTS Build/release agent SQL Server Hosted
On premise SQL Server
14
VSTS Build/Release Agent
Default hosted agent (runs in Azure cloud) Single one is free, can purchase more (~$40/month) On-premise agent ~$15/month for additional parallel builds Install once, self-updating Run as a service, use a domain account (easier for connecting to SQL Server services) Installed tools: Visual Studio 2015, SSDT, SQL Management Studio
15
VSTS Build Steps Trigger Compile Solution Copy Build Artifacts
Check In By Request Scheduled Compile Solution Devenv.exe Copy Build Artifacts *.dacpac *.ispac *.asdatabase Deployment files
16
DEVENV.EXE (Compile Projects)
Project support from MSBuild Compilation outputs: Database projects (*.sqlproj) - *.dacpac SSAS projects (*.tabproj) - *.asdatabase SSIS projects (*.dtsproj) - *.ispac SSRS projects (*.rptproj) – none!
17
VSTS Release Steps Trigger Get Build Artifacts Deploy artifacts
Successful Build Release Pre-approval By Request Get Build Artifacts *.dacpac *.ispac *.asdatabase Deployment files Deploy artifacts Complete Release Post-approval
18
SQLPACKAGE.EXE (Database Deployment)
C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin Connects to SQL Server (or Azure SQL Database) /Action:Publish /SourceFile:<project>.dacpac /Profile:<Database>.publish.xml Publish profiles Target server, database SqlCmd environment $(variable)s Uses compilation output <project>.dacpac and <db>.publish.xml profile
19
SQLPACKAGE.EXE (Database Update Script)
C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin Connects to SQL Server (or Azure SQL Database) /Action:Script /SourceFile:<project>.dacpac /OutputPath:<database_name>.sql /Profile:<Database>.publish.xml Generates change script only Use in a Build definition and save the script as a build artifact Include the script in the pre-release approval workflow for review
20
SQLPACKAGE.EXE (Deployment Report)
C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin Connects to SQL Server (or Azure SQL Database) /Action:DeployReport /SourceFile:<project>.dacpac /OutputPath:<database_deploy>.xml /Profile:<Database>.publish.xml Generates Xml summary of deployment actions Use in a Build definition and save the report as a build artifact Include the report in the pre-release approval workflow for review Bonus points: Use a PowerShell script and an XSLT file to transform the Xml report into an html file
21
Deployment Wizard (SSAS Deployment)
C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\ Microsoft.AnalysisServices.Deployment.exe /a Answer Mode generates .deploymenttargets .deploymentoptions .configsettings Uses compilation output <Model>.asdatabase and answer files
22
ISDEPLOYMENTWIZARD.EXE (SSIS Deployment)
C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn Connects to SQL Server Integration Services server Project Deployment Model SSISDB configured Create Folders for Dev, Test, Prod Create Environments Uses compilation output <Project>.ispac IsDeploymentWizard will not Create folders Create environments Configure projects with environment SSISDB has stored procedures to do this
23
SSRS Reports (Report deployment)
Use Devenv.exe with Deploy target Use project/solution configurations for Dev, Test, Prod
24
VSTS Agent Security Connections to SQL Server services generally use Trusted Connections Using passwords is difficult, especially if you don’t want them in plain text anywhere SQLPACKAGE Agent account requires VIEW ANY DEFINITION permission for DeployReport and Script actions Requires dbo permission in target database Sysadmin server role allows for creation of new databases SSAS Deployment Agent account requires Administrator role membership for SSAS SSIS Deployment Agent account requires sysadmins role membership or SSISDB database role package_admins SSRS Deployment Agent account requires Contributor or Administrator permissions at the target server URL
25
Environment Configurations
Database <db>.publish.xml Target server Target database SqlCmd variables SSAS <model>.deployoptions <model>.deploytarget <model>.something Overwrite options Retain, Deploy Processing option Full, Default SSIS SSISDB Environments Variables Connection Strings Deploy will not overwrite SSRS Project configuration Target server URL Target Folders
26
Thank you Mike Diehl Practice Lead, Databases and Business Intelligence Winnipeg , Calgary, Dallas, and everywhere!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.