Microsoft's Azure SQL team introduced two new publish options in the SqlPackage 170.6 preview on November 16, 2026. One writes a record of every deployment into the target database, and the other uses that record to bypass the complete schema compare when the same model is published again.
This matters for teams that deploy SQL Server and Azure SQL schemas from CI/CD pipelines. Today a pipeline retry or a re-run of an unchanged build still pays for a complete comparison of the .dacpac against the live database, even though nothing will change.
What Is New in the Preview
The features ship in the NuGet package Microsoft.SqlPackage 170.6.40-preview, whose executable reports version 170.6.40.1. Both are publish properties, and both are off unless you turn them on:
- LogDeployment stores deployment history in a table named DeploymentHistory inside a sqlproj schema in the target database.
- EnableFastComparison lets SqlPackage check the last history record first and skip the full comparison when it matches. It only works together with LogDeployment and needs an existing database that already holds compatible history.
Logging can be used alone. Microsoft suggests that as a first step for teams that want an audit trail but still want every publish to compare the real schema.
The matching DacFx 170.6.28-preview release notes on GitHub list the same public options. That build also adds SQL project reference support in compare and publish, a PrePlanScript step for script generation, and lower memory use when extracting large schemas.
How Fast Comparison Decides
The shortcut does not look at a friendly version label such as 1.0.0. SqlPackage calculates a checksum of the source model and compares it, along with the deployment options in use, to the most recent entry in the history table.
When both match, the tool does not reverse engineer the target database and does not build a deployment plan. The publish output prints a message saying a fast comparison match was found, so you can confirm in pipeline logs which path was taken.
In every other case the normal path runs. That covers a brand new database, a database with no usable history, a changed .dacpac, and a publish that uses different options from last time.
Using the Project Version Inside Scripts
The history table also carries the project version. If you set DacVersion in the .sqlproj file and publish with logging on, supported targets store that version with each history row.
SqlPackage then passes two SQLCMD variables to pre-deployment and post-deployment scripts. DacVersion holds the version of the incoming package, and DacVersion_Previous holds the version most recently recorded for that project, or 0.0.0 when there is none.
This lets a script run a data fix only for one release, or only when upgrading from a specific earlier release. The variables are not supplied when logging is off, and the incoming value always comes from the package metadata, not from an override given at publish time.
Limits to Know Before You Enable It
Microsoft is clear about what the preview does not do, and several points deserve attention:
- A history match is not a drift check. If someone changed the database by hand, the fast path will not notice, because it never reads the live schema.
- On a fast match, pre-deployment and post-deployment scripts do not run at all. On the normal path they run even when no schema change is found.
- Version order is not enforced. Nothing stops an older package from being published over a newer one.
- History is a record only. It offers no rollback and does not replace backups.
- The workflow should not be mixed with DAC registration. Keep RegisterDataTierApplication at its default of False, and unregister a database that is already registered before adopting it.
The layout of the history table may also change while the feature is in preview. Microsoft advises treating it as metadata owned by the tool and not editing it or building application logic on its columns.
What It Means for Developers
The clearest gain is in pipelines that publish the same build many times, such as retries after an unrelated failure or fan-out deployments to many identical databases. For large schemas, comparison is often the slowest part of a publish, so skipping it can shorten those runs noticeably.
The script behavior is the main trap. Teams that rely on a post-deployment script to refresh reference data on every publish will see that step silently dropped whenever the fast path is chosen. Review those scripts first, and keep them safe to rerun because the normal path still executes them each time.
A sensible rollout is to enable LogDeployment alone in a test environment and look at what the history table records. Add EnableFastComparison only for databases that are changed through the pipeline and nowhere else. Where manual hotfixes are possible, leave fast comparison off or schedule a regular publish without it to catch drift.
If you also watch Azure SQL changes, our recent reports on managed performance monitoring for Azure SQL Managed Instance and the backup immutability lock for Azure SQL cover two other previews from the same team.
How to Try It
Because this is a preview, Microsoft recommends installing it next to your stable copy and not over it. The dotnet tool install command accepts a tool path and the exact preview version, which keeps the global SqlPackage untouched.
Microsoft's walkthrough extracts the schema of a sample database to a .dacpac and publishes it twice to a new database with both options enabled. The first publish follows the normal path and creates the history; the second one should report the fast comparison match.
After that, you can query the DeploymentHistory table in the sqlproj schema to see what was logged. To force a full comparison at any time, publish again with EnableFastComparison set to False while leaving logging on.
Conclusion
SqlPackage 170.6 preview gives DACPAC-based deployments a built-in history table and an opt-in way to skip comparison work on unchanged repeat publishes. It keeps the declarative model, but the skipped scripts and the lack of drift detection mean fast comparison fits best where the pipeline is the only path to the database.
Sources
- Azure SQL Dev Blog: SqlPackage Deployment History and Fast Comparison Preview
- GitHub: Microsoft.SqlServer.DacFx 170.6.28-preview release notes
- NuGet: Microsoft.SqlPackage 170.6.40-preview
See my articles more often when you search Google.
