Jump to content

Announcing General Availability of Azure Data Studio extension SQL Database Projects


Recommended Posts

Guest DrewSkwiersKoballa
Posted

The SQL Database Projects extension in Azure Data Studio is now generally available and brings project-based development to databases. Compatible databases include SQL Server, Azure SQL Database, Azure SQL Managed Instance, and Azure Synapse SQL.

 

 

 

What are SQL projects?

 

 

SQL projects are a local representation of SQL objects that comprise a single database, such as tables, stored procedures, and functions. Beyond the objects of a database, the database-as-code concept is extended with database-level settings and pre/post-deployment scripts in SQL projects. When a SQL project is built, the output artifact is a dacpac file that represents the state of a database.

 

largevv2px999.png.3d7c7836fabcd9736aff61e4c5bb6594.png

 

 

 

The SQL Database Projects extension is also available in VS Code and will be updated to general availability soon. SDK-style SQL projects based on Microsoft.Build.Sql remain in preview and provide improved functionality for building projects in cross-platform environments. We look forward to bringing Microsoft.Build.Sql to general availability in the coming months.

 

 

 

 

 

Recent improvements

 

 

In recent releases of the SQL Database Projects extension, the project tree has been enhanced with the ability to move/rename files and visibility to SQLCMD variables. SQLCMD variables are a powerful capability of SQL projects that enable a variable to be placed in T-SQL code that is not set until a dacpac is deployed, creating flexibility and reusability in the dacpac build output artifact.

 

mediumvv2px400.png.d84456665f9105f09659a9b7aa8adbb6.pngDatabase Projects view in Azure Data Studio with SQLCMD Variables and database objects

 

 

 

SQL projects deployment

 

 

The SQL Database Projects extension also provides a convenient workflow to create development environments from SQL projects quickly. Behind the scenes, Azure Data Studio starts a container on your local workstation and deploys the SQL project to it. Containers are available for local development environments from projects targeting SQL Server and Azure SQL Database.

 

mediumvv2px400.png.24af8d28c4572bb188f66c19608307f2.pngPublish project dialog with Publish to new SQL server local development container selected

 

 

Ease of deployment doesn’t stop at the local development environment. SQL projects are readily deployed to test, staging, and production environments with automation through the SqlPackage command line tool or with built-in actions for Azure DevOps and GitHub Actions. The deployment process determines the differences between the source and target, automatically applying the necessary changes to obtain the desired state. Through SQL projects, starting with the SQL Database Projects extension in Azure Data Studio, you can drive your entire SQL development lifecycle.

 

 

 

largevv2px999.png.1dbbf60eba3ecd658be33fb342dc6679.png

 

Getting started

 

 

Getting started with SQL projects can be intimidating, but there are flexible options for your first steps. When working with SQL projects in an established environment, you may want to create a project directly populated with objects from an existing database. With the SQL Database Projects extension installed in Azure Data Studio, a new option is available in Object Explorer to “Create Project from Database”.

 

mediumvv2px400.png.abd7d3dda17ec7230082a6d92fbb6562.png

 

 

In the future, you won’t need to fret if your database has changes that aren’t in the project, because established SQL projects can also be updated from a database. The same schema compare interface that is used for comparing databases and dacpacs can also be used to review changes before applying them to SQL project.

 

largevv2px999.png.c3ccb51e9309a751f8daa31dfb615238.pngSchema compare displaying differences between a SQL project and a database

 

Schema compare displaying differences between a SQL project and a database

 

 

 

Learn more

 

 

Learn more about the SQL Database Projects extension, now generally available, from our documentation: SQL Database Projects extension - Azure Data Studio

 

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...