Download presentation
Presentation is loading. Please wait.
Published byMyrtle Gray Modified over 6 years ago
1
Microsoft Ignite NZ 25-28 October 2016 SKYCITY, Auckland
2
DACFx What is it, why should you care and what can you use it for?
M404 Hannah Gray, Technical Group Lead, Xero Images: Can Stock Photo Inc. (under license) or openclipart.org (Public Domain CC1.0)
3
Warning: I’m assuming you’re comfortable with
Microsoft Ignite 2016 11/27/2018 4:18 PM Warning: I’m assuming you’re comfortable with SQL Server SQL Server Data Tools .dacpacs Build / deployment processes Object-oriented programming © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
4
What exactly is DACFx?
5
Data Tier Application Framework
6
“…the core technology SQL Server Data Tools leverages for incremental database deployments, modelling and validation of database schemas and other key functionality…”
7
Where DacFx fits in Data Application Tier Framework
Microsoft Ignite 2016 11/27/2018 4:18 PM Where DacFx fits in Data Application Tier Framework Read and extract a database Deploy a dacpac/bacpac Migrate from SQL Server to Azure SqlPackage.exe © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
8
… and it has an API Microsoft Ignite 2016 11/27/2018 4:18 PM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
9
Data-Tier Application Component (DAC)
Microsoft Ignite 2016 11/27/2018 4:18 PM Where DacFx API fits in Data-Tier Application Component (DAC) .NET API © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
10
Interesting. Let’s talk some more.
11
What can you even do? Sqlpackage.exe-like operations on DACPAC/BACPACs
Code Analysis Customise your deployment Interrogate and alter the database model Microsoft.SqlServer.Dac Microsoft.SqlServer.Dac.CodeAnalysis Microsoft.SqlServer.Dac.Deployment Microsoft.SqlServer.Dac.Model
12
Prerequisites Nuget Package Microsoft.SqlServer.DacFx.x64
DacFramework.msi
13
Supports all the things
SQL Server Azure
14
Demo Start simple, automating a deploy
15
The secret sauce TSqlModel
Microsoft Ignite 2016 11/27/2018 4:18 PM The secret sauce TSqlModel © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
16
Concepts TSqlModel TSqlObject Properties Metadata
Microsoft Ignite 2016 11/27/2018 4:18 PM Concepts TSqlModel TSqlObject Properties Metadata © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
17
PROPERTIES PROPERTIES TSqlModel PROPERTIES PROPERTIES METADATA
AnsiNullsOn (bool) ChangeTrackingEnabled (bool) ChangeDataCaptureEnabled (bool) QuotedIdentifierOn (bool) … PROPERTIES Microsoft Ignite 2016 11/27/2018 4:18 PM [dbo].[User] : TSqlObject [dbo].[User] : TSqlObject [dbo].[User] : TSqlObject [dbo].[User] : TSqlObject Clustered (bool) WithPadIndex (bool) FillFactor (int) … PROPERTIES UserId: TSqlObject [PK_User]: TSqlObject Nullable (bool) Scale (int) Precision (int) IdentitySeed (int) IdentityIncrement (int) IsIdentity (bool) … PROPERTIES TSqlModel Column (ColumnType) METADATA PermissionType (bool) WithGrantOption (int) … PROPERTIES GRANT SELECT: TSqlObject © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
18
Rule 1 Everything is a TSqlObject It has Properties
It may have Metadata
19
Concepts References GetChildren GetParent GetReferenced GetReferencing
20
Schema Table View Primary Key Constraint Column DataType Heirarchical
Microsoft Ignite 2016 11/27/2018 4:18 PM Schema Heirarchical View.Schema Heirarchical Table.Schema Table View Heirarchical PrimaryKeyConstraint.Host Composing View.Columns Composing Table.Columns Primary Key Constraint Column DataType Peer PrimaryKeyConstraint.Columns Peer Column.DataType © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
21
Rule 2 You navigate around using Relationships
You need to know the type of Relationship you want to navigate
22
Concepts DacQueryScopes UserDefined BuiltIn SameDatabase System
Default All
23
Demo Exploring the public model of a .dacpac Microsoft Ignite 2016
11/27/2018 4:18 PM Demo Exploring the public model of a .dacpac © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
24
Right, let’s get cooking!
25
Deployment contributors
Microsoft Ignite 2016 11/27/2018 4:18 PM Deployment contributors Build BuildContributor Deploy DeploymentPlanModifier DeploymentPlanExecutor © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
26
Code analysis For SQL, not just .NET! Continuous Integration anyone?
Microsoft Ignite 2016 11/27/2018 4:18 PM Code analysis For SQL, not just .NET! Continuous Integration anyone? © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
27
Demo Make things better Microsoft Ignite 2016 11/27/2018 4:18 PM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
28
So what? Microsoft Ignite 2016 11/27/2018 4:18 PM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
29
Just imagine… Cross environment issues
Microsoft Ignite 2016 11/27/2018 4:18 PM Just imagine… Cross environment issues Support edition-dependent features Auditing or notifications Managing Availability Groups © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
30
Microsoft Ignite 2016 11/27/2018 4:18 PM Resources Explaining the Model (SQL Server Data Tools Team) Walkthroughs on Contributors(MSDN) DacFx Code Samples (Microsoft) General SSDT and DacFx fu © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
31
11/27/2018 4:18 PM © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.