0% found this document useful (0 votes)
7 views

Streamline Development with Azure SQL Database Dev Containers- Azure SQL Devs’ Corner

Uploaded by

Carlos Chacon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Streamline Development with Azure SQL Database Dev Containers- Azure SQL Devs’ Corner

Uploaded by

Carlos Chacon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Dev Blogs Developer 

Theme Sign in
Dev Blogs Technology
Azure SQL Devs’ Corner 
Simplify development with Dev Container templates for Azure SQL Database

Languages

August 16th, 2024 .NET

Simplify development with Dev Container templates


Platform Development
for Azure SQL Database

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.

What are Dev Containers?


A development container essentially packages up your project’s development environment using
Feedback

the Development Container Specification ( devcontainer.json ). This specification enriches your


container with metadata and content necessary to enable development from inside a container.
Workspace files are mounted from the local file system or copied or cloned into the container.
Extensions are installed and run inside the container, where they have full access to the tools,
platform, and file system. This means that you can seamlessly switch your entire development
environment just by connecting to a different container.

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.

Introducing Dev Container Templates for Azure SQL Database

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

Dev Containers streamline the development process by providing an out-of-the-box environment


configured for Azure SQL Database. This eliminates the need for developers to spend time
searching for and setting up VS Code extensions to interact with their database and preferred
programming language. With these templates, you can dive straight into coding, boosting
productivity and reducing setup friction.

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.

Benefits of Using Dev Containers


Dev Containers ensure a consistent and seamless experience, promoting smooth collaboration
across teams and workflows, and facilitating an easy transition to Azure environments. Key
benefits include:
Feedback

Preconfigured environments: These come with all necessary tools and dependencies.

Consistency: Maintain uniformity across different development setups.


Simplified setup: Reduce time spent on configuration.

Enhanced collaboration: Improve teamwork within development teams.

Seamless transition to Azure: Leverage the scalability and reliability of Azure SQL Database
for production deployments.

Accelerated time-to-market: Streamline development workflows and integrate seamlessly


with existing toolsets, giving businesses a competitive edge.

Cost-efficient development: Reduce dependencies on cloud resources during the


development and testing phases.

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:

Git: For version control

Docker: Required for running containers

Visual Studio Code: The primary IDE to use Dev Containers

Dev Containers extension for Visual Studio Code: Enables working with Dev Containers

To set up your environment, follow these steps:

1. First, ensure you have Git installed for version control.

2. Then, install Docker, which is necessary for running 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.

Setting up the Dev Container template for Azure SQL Database


Feedback

Creating a Dev Container


Begin by either opening a local folder containing your application project or cloning an existing
repository into Visual Studio Code. This initial step sets the stage for integrating your project with
a development container, whether you’re starting from scratch or working on an existing
application. In Visual Studio Code, open the command palette (press F1 or Ctrl+Shift+P on
Windows and Cmd+Shift+P on macOS). Select the
Dev Containers: Add Dev Container Configuration Files command.

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.

Building the Container

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

What are Dev Containers?

Introducing Dev Container Templates for Azure SQL Database

Benefits of Using Dev Containers

Prerequisites

Setting up the Dev Container template for Azure SQL Database

Creating a Dev Container

Building the Container

Exploring and verifying the Dev Container

Show more
Feedback

Read next

A t 26 2024
August 26, 2024

Retrieval Augmented Generation with


Azure SQL

Davide Mauri

August 29, 2024

Vector Support EAP extended to Azure


SQL MI

Davide, Pooja

Exploring and verifying the Dev Container


After you build the dev container, start exploring and verifying the setup. Open a terminal within
Visual Studio Code to check that all necessary tools are installed and working correctly.

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

Azure SQL Containers Dev Containers GitHub VS Code

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.

Enter your email Subscribe


By subscribing you agree to our Terms of Use and Privacy

Follow this blog

What's new Microsoft Education Business Developer & Company


Store IT
Surface Pro Microsoft in Microsoft Cloud Careers
Account profile education Azure
Surface Laptop Microsoft Security About Microsoft
Download Center Devices for Developer Center
Surface Laptop education Dynamics 365 Company news
Studio 2 Microsoft Store Documentation
support Microsoft Teams Microsoft 365 Privacy at
Surface Laptop Go 3 for Education Microsoft Learn Microsoft
Returns Microsoft Power
Microsoft Copilot Microsoft 365 Platform Microsoft Tech Investors
Order tracking Education Community
AI in Windows Microsoft Teams Diversity and
Certified How to buy for Azure inclusion
Explore Microsoft Refurbished your school Microsoft 365 Marketplace
products Copilot Accessibility
Microsoft Store Educator training AppSource
Windows 11 apps Promise and development Small Business Sustainability
Visual Studio
Flexible Payments Deals for
students and
Feedback

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

You might also like