Streamline Development with Azure SQL Database Dev Containers- Azure SQL Devs’ Corner
Streamline Development with Azure SQL Database Dev Containers- Azure SQL Devs’ Corner
Theme Sign in
Dev Blogs Technology
Azure SQL Devs’ Corner
Simplify development with Dev Container templates for Azure SQL Database
Languages
Data Development
Carlos Robles
Senior Product Manager
Feedback
In today’s fast-paced
software development landscape, having a reliable and efficient local development setup is
crucial. Dev Containers provide developers with a seamless way to build and test applications
locally before deploying them to the cloud.
We are announcing the Public Preview of Dev Container templates for Azure SQL Database. This
release provides pre-configured development environments tailored for Azure SQL Database,
making it easier for developers to integrate and work with Azure SQL Database in their projects. In
this blog post, we’ll explore these new development container templates, discuss their benefits,
and guide you through setting up your development environment.
Dev Container Templates are source files packaged together that encode configuration for a
complete development environment, while Dev Container Features allow us to add runtimes,
tools, and libraries inside a container. As a result, all this put together ensures a consistent and
reproducible development environment from any tool that supports the Development Container
Specification.
When you open your project in the dev container, your code will just work without downloading
anything on your local machine. Furthermore, the best part is that when connected to a dev
container, your developer experience is exactly the same as if you opened the project locally in VS
Code.
We are excited to introduce new Dev Container templates specifically designed for Azure SQL
Database. These templates support multiple programming languages, including .NET 8, .NET
Aspire, Python, and Node.js, making it easier for developers to get started quickly and focus on
building their applications.
Feedback
Included with the templates is a pre-built demo database called Library, which serves as a
practical example to help developers get started quickly. While these Dev Containers use the
Azure SQL Edge container image, which offers a surface area close to Azure SQL Database, using
SQL Database Projects ensures that your database code remains compatible with Azure SQL
Database. With this demo project, you can easily use the dacpac artifact created by SQL Database
Projects and deploy it to Azure SQL Database using the Azure SQL Action for GitHub Actions. This
process streamlines your workflow and ensures seamless integration with your production
environment.
Whether working locally or in the cloud, dev containers ensure consistency across development
environments, making it easier to collaborate and maintain high standards across your team. With
the inclusion of essential tools like SQLCMD, SqlPackage, Azure Command-Line Interface (CLI) and
Azure Developer CLI (AZD), these templates offer a comprehensive solution for enhancing your
development workflow with Azure SQL Database.
Preconfigured environments: These come with all necessary tools and dependencies.
Seamless transition to Azure: Leverage the scalability and reliability of Azure SQL Database
for production deployments.
By using dev containers, developers can avoid the hassle of setting up and configuring their local
development environment manually.
Prerequisites
Before you begin, make sure you have the following tools installed on your local machine:
Dev Containers extension for Visual Studio Code: Enables working with Dev Containers
3. After that, download and install Visual Studio Code, as it will be your primary IDE for using
Dev Containers.
4. Lastly, add the Dev Containers extension to Visual Studio Code to enable seamless
containerized development.
Select the Add configuration file to workspace option if you want to add the dev container
configuration file to your current local repository. Alternatively, choose the Add configuration file
to user data folder option. For this qiuckstart, select the Add configuration file to workspace
option.
Feedback
Visual Studio Code prompts you to select a Dev Container template. The available templates are
based on the tools and dependencies required for the specific development environment. Select
Show All Definitions to view all available templates.
Feedback
Next, select the desired Dev Container template for Azure SQL Database by typing Azure SQL into
the command palette. This action displays a list of available templates designed for Azure SQL
Database development.
Upon selection, Visual Studio Code automatically generates the necessary configuration files
tailored to the chosen template. These files include settings for the development environment,
extensions to install, and Docker configuration details. They’re stored in a .devcontainer folder
within your project directory, ensuring a consistent and reproducible development environment.
Feedback
Following the configuration file generation, Visual Studio Code prompts you to transition your
project into the newly created Dev Container environment. You can do it by selecting Reopen in
Container. This step is crucial as it moves your development inside the container, applying the
predefined environment settings for Azure SQL development.
If you haven’t already, you can also initiate this transition manually at any time using the Dev
Containers extension. Use the Reopen in Container command from the command palette or
select on the blue icon at the bottom left corner of Visual Studio Code and select Reopen in
Container.
Feedback
This action initiates the setup process, where Visual Studio Code generates the necessary
configuration files and builds the development container based on the selected template. The
process ensures that your development environment is precisely configured for Azure SQL
Database development.
Visual Studio Code builds the container based on the selected configuration. The build process
might take a few minutes the first time.
Feedback
Table of contents
Prerequisites
Show more
Feedback
Read next
A t 26 2024
August 26, 2024
Davide Mauri
Davide, Pooja
Feedback
As an optional step, you can also run predefined tasks directly from the command palette,
streamlining your development workflow and allowing you to focus on writing code.
Feedback
Feedback
For more detailed information about specific templates, visit Azure SQL Database Dev Container
templates.
Conclusion
Dev Containers for Azure SQL Database offer a powerful and efficient way to streamline your
development process. By providing a consistent, portable environment, they help you focus on
writing code and building features rather than configuring your setup. We encourage you to
explore these templates and see how they can enhance your development workflow for Azure
SQL Database.
Looking ahead, we will delve into more advanced topics like integrating Azure services with Dev
Containers to further optimize your development process. Stay tuned for more insights and
practical guides to help you get the most out of Azure SQL Database and Dev Containers.
Category
Topics
Azure SQL Database Containers Dev Containers Docker Local Development VS Code
Author
Carlos Robles
Senior Product Manager
With 12+ years navigating the tech landscape, I've evolved from a Software Developer to a Data specialist and
Feedback
later to a Solutions Architect, and now I work as a Product Manager at Microsoft. I've been honored with
prestigious awards, including Microsoft MVP, and recognition in the Redgate 100 for DevOps excellence.
Currently, I specialize in empowering developers to embrace Azure SQL. As an international speaker, author, and
mentor, I thrive on catalyzing the adoption of Azure SQL among ...
More about author
0 comments
Discussion are closed.
Stay informed
Get notified when new posts are published.
parents
Azure for
students
Your Privacy Choices Consumer Health Privacy
Sitemap Contact Microsoft Privacy Terms of use Trademarks Safety & eco Recycling About our ads
© Microsoft 2024
Feedback