SkillAgentSearch skills...

DacFx

DacFx, SqlPackage, and other SQL development libraries enable declarative database development and database portability across SQL versions and environments. Share feedback here on dacpacs, bacpacs, and SQL projects.

Install / Use

/learn @microsoft/DacFx
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

DacFx and Related Components

|Component|Links|Summary| |:--|:--|:--| |SqlPackage|📦 Tool<br/>📗 Docs|Microsoft.SqlPackage is a cross-platform command-line utility for creating and deploying .dacpac and .bacpac packages. SqlPackage can be installed as a dotnet tool.| |DacFx|📦 NuGet<br/>📘 API Docs|The Microsoft SQL Server Data-Tier Application Framework (Microsoft.SqlServer.DacFx) is a .NET library which provides application lifecycle services for database development and management for Microsoft SQL Server and Microsoft Azure SQL Databases. Preview versions of DacFx are frequently released to NuGet.| |DacpacVerify|📦 Tool|Microsoft.DacpacVerify is a cross-platform command-line utility for checking that two .dacpac packages match, including pre/post-deployment scripts and SQLCMD variables.| |Dacpacs.(Master,Msdb)|📦 Master<br/>📦 Msdb|Microsoft.SqlServer.Dacpacs.Master and Microsoft.SqlServer.Dacpacs.Msdb is a set of NuGet packages containing .dacpac files for Microsoft SQL Server system databases (master, msdb) with versions across SQL Server 2008 (100) through SQL Server 2025 (170).| |Dacpacs.Azure.Master|📦 NuGet|Microsoft.SqlServer.Dacpacs.Azure.Master is a NuGet package containing a .dacpac file for the Azure SQL Database master database.| |Dacpacs.DbFabric|📦 NuGet|Microsoft.SqlServer.Dacpacs.DbFabric is a NuGet package containing a .dacpac file for the SQL database in Fabric system objects.| |Dacpacs.FabricDw|📦 NuGet|Microsoft.SqlServer.Dacpacs.FabricDw is a NuGet package containing a .dacpac file for the Warehouse in Fabric master database objects.| |Dacpacs.Synapse.Master|📦 NuGet|Microsoft.SqlServer.Dacpacs.Synapse.Master is a NuGet package containing a .dacpac file for the Azure Synapse Analytics master database.| |Dacpacs.SynapseServerless.Master|📦 NuGet|Microsoft.SqlServer.Dacpacs.SynapseServerless.Master is a NuGet package containing a .dacpac file for the Azure Synapse Analytics serverless SQL pools master database.| |ScriptDom|📦 NuGet<br/>🛠️ Code<br/>📘 API Docs|Microsoft.SqlServer.TransactSql.ScriptDom is a NuGet package containing the Transact-SQL parser ScriptDOM. The source code is licensed MIT.| |Microsoft.Build.Sql|📦 NuGet<br/>🛠️ Code|Microsoft.Build.Sql is a .NET project SDK for SQL projects, compiling T-SQL code to a data-tier application package (dacpac). Source code in this repository.| |Project Templates|📦 NuGet<br/>🛠️ Code|Microsoft.Build.Sql.Templates is a set of .NET project templates for SQL projects. Source code in this repository.|

Microsoft.Build.Sql SDK-style projects documentation

Related tools and libraries

Quickstart

🛠️ Install SqlPackage

SqlPackage is a command line interface to DacFx and is available for Windows, macOS, and Linux. For more about SqlPackage, check out the reference page on Microsoft Docs.

If you would like to use the command-line utility SqlPackage for creating and deploying .dacpac and .bacpac packages, you can obtain it as a dotnet tool. The tool is available for Windows, macOS, and Linux.

dotnet tool install -g microsoft.sqlpackage

Alternatively, SqlPackage can be downloaded as a zip file from the SqlPackage documentation.

📁 Create a SQL project

Install the Microsoft.Build.Sql.Templates NuGet package to get started with a new SQL project.

dotnet new install Microsoft.Build.Sql.Templates

Create a new SQL project using the sqlproj template.

dotnet new sqlproj -n ProductsTutorial

Add a new table dbo.Product in a .sql file alongside the project file.

CREATE TABLE [dbo].[Product](
    [ProductID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
    [ProductName] [nvarchar](200) NOT NULL
);

Build the project to create a .dacpac file.

dotnet build

🛳️ Publish a SQL project

Publish a SQL project to a database using the SqlPackage publish command. Learn more about the publish command in the SqlPackage documentation, where additional examples and details on the parameters are available.

# example publish to Azure SQL Database using SQL authentication and a connection string
sqlpackage /Action:Publish /SourceFile:"bin/Debug/ProductsTutorial.dacpac" \
    /TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=ProductsTutorial;User ID=sqladmin;Password={your_password};Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"

Repository Focus

Feedback

This repository is available for transparently triaging and addressing feedback on DacFx, including the NuGet package and the cross-platform CLI SqlPackage.

We love hearing from you! We encourage you to upvote existing feedback and add new feedback so we can prioritize the work that will have the biggest impact for our users. Feedback locations:

Roadmap

The roadmap for DacFx, related components, and the SQL projects ecosystem is available on the repo wiki.

Related Open Source Projects

This repository is available to make related open source components accessible even from their early stages. Feedback and contributions are welcome!

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see Code of Conduct.

View on GitHub
GitHub Stars444
CategoryDevelopment
Updated7d ago
Forks27

Languages

C#

Security Score

100/100

Audited on Mar 25, 2026

No findings