Azure Data Studio is a powerful tool for database and business intelligence developers who want to use declarative database development. In this article, we will discuss the two standard ways of building SQL Database Projects in Azure Data Studio and provide step-by-step instructions for implementation.
Getting Ready for Database Projects
Before we can start building database projects in Azure Data Studio, we need to ensure that the necessary extensions are installed. The two must-have extensions for building database projects are:
- SQL Database Project Extension
- SQL Server Schema Compare Extension
To add these extensions, open Azure Data Studio and click on Extensions from the left navigation bar (or use the shortcut key CTRL+SHIFT+X). Search for “SQL Database Projects” and click Install. Repeat the same process for the “SQL Server Schema” extension.
Method 1: Creating Project from Database
The first method is to create a database project from an existing database. This can be a production database or a development database.
If you want to manage and control all your database changes via SQL Database Projects, it is advisable to create a project from a production database. This ensures that the project serves as the single source of truth for all database changes.
If you already have an existing database development strategy but want to test the database projects approach, you can create a project from a dev/test database. In this case, the scope of the database project is limited to you, and actual database changes are deployed using the existing method.
To create a project from a database, follow these steps:
- Create a database
- Create an object (table) in the database
- Create a SQL Database Project from the database
- Compile (Build) the project
- Add another object (table) to the database and recompile (Build) the project
- Publish your changes to the database
- View your changes
For detailed implementation steps, please refer to the original article.
Method 2: Creating Database Project as a Starter
The second method is to start your database development right from the database project. This method is recommended if you have no specific reason not to do so.
Follow these steps to create a blank database project:
- Go to the Projects section in Azure Data Studio
- Click the plus sign to add a new project
- Add a name and location for the project
- Click OK to create the project
Once the project is created, you can build and publish it to deploy your changes to the database. For detailed steps, please refer to the original article.
A Word of Advice
Azure Data Studio is a powerful tool for database development, but it is important to note that SQL Server Data Tools (SSDT) is still the dominant toolset for this purpose. However, Azure Data Studio and SSDT can be used in a complementary fashion.
Development teams can mix and match these two tooling options based on their preferences and objectives. Some team members can use Visual Studio with SSDT, while others can use Azure Data Studio. As long as everyone is aware of their scope of work, this approach can be equally workable and productive.
Conclusion
Azure Data Studio provides two standard ways to build SQL Database Projects. Whether you choose to create a project from an existing database or start from a blank project, Azure Data Studio offers a powerful and efficient environment for declarative database development.
By following the steps outlined in this article, you can successfully build and deploy database projects in Azure Data Studio.