Welcome to the new Azure SQL Database local development experience!
The “inner loop” in software development workflows is the process of writing, building, debugging and testing code, usually on a local workstation or development environment, before sharing it with someone else. In contrast, the “outer loop” kicks off as soon as that code is checked in a source control system from where CI/CD pipelines can manage all required steps (including testing and validation) to publish code artefacts and configuration to production systems.
Modern database development follows a similar path, but it requires some specific capabilities as we’re dealing with a rich, fully stateful service like a relational database system for hosting our artefacts (database schema, functions, procedures, index definitions, etc.).
At Build 2022 We are introducing a local development experience for Azure SQL Database as a key building block in supporting database developers across the inner and outer loops of their database development workflows.
Local development experience for Azure SQL Database includes a series of extensions for Visual Studio Code and Azure Data Studio and a new Azure SQL Database emulator that lets developers to publish and run their database projects locally, on a containerised, cross-platform emulator providing close fidelity with Azure SQL Database public service while enabling a complete offline experience for running and testing their databases.
End to end database development experience.
Key extensions for the local development experience are mssql and SQL Database Project. The former manages all connection aspects with Azure SQL Database emulator and public service, and lets developers to browse and query local and remote databases. It can also be used to point to an existing database and generate a SQL Database Project that can be used for subsequent modifications.
SQL Database Project extension supports developers in creating their database projects, building and validating schemas and other objects against Azure SQL Database syntax and capabilities. Finally, it supports publishing these projects to the local emulator for further testing and validation and, once passed, to a new or existing logical server in Azure SQL Database public service.
In Azure Data Studio, we also provide additional extensions that can support the database development process like Schema Compare, where developers can compare a source and target SQL Project or a live Azure SQL Database running in the emulator or in the public service, verify the differences and even generate a script to reconcile the two. More extensions covering other areas of the database development process such as design, testing and troubleshooting will be added in the future.
Database projects can be checked in source control systems, such as GitHub repos, together with other code artefacts and projects, providing a true “database as code” experience for designing, implementing and maintaining databases as part of the entire end-to-end solution. From there, developers and DevOps teams can leverage features like GitHub Actions for publishing a new database or a schema change to a test or production environment in Azure SQL Database public service.
Learn how to setup the new local development experience for Azure SQL Database by following our official documentation, which includes also a step by step quickstart guide to build and publish your first database project.
We’re planning to expand our end-to-end developer experience significantly in the future, covering more scenarios and use cases across all phases of the database development workflow. You can read a dedicated blog post on this subject, and leave your feedback, requests or suggestions in the comments section.