Skill 2.3.8
Update an SQL database project and deploy changes
Key Concepts
A developer edits the object definitions (for example adds a column to the CREATE TABLE statement), builds, and publishes with SqlPackage /Action:Publish /SourceFile:app.dacpac /TargetConnectionString:.... SqlPackage compares the model with the target and generates only the needed changes, in dependency order. A publish profile (.publish.xml) stores properties such as BlockOnPossibleDataLoss (default True), DropObjectsNotInSource (default False), GenerateSmartDefaults and SQLCMD variable values.
Pipelines often split deployment into building the dacpac once, generating a deploy report or script for review, and publishing the same artifact to test, staging and production. Changes that the declarative model cannot express safely, such as splitting a column and moving data, use pre- and post-deployment scripts. In GitHub Actions, the azure/sql-action action can publish a dacpac or project, and SqlPackage can be run directly with an access token from the logged-in identity.