Skip to content

Commit

Permalink
Updating image, updating main README and NOTES according to the proje…
Browse files Browse the repository at this point in the history
…ct guidelines.
  • Loading branch information
croblesm committed Jun 24, 2024
1 parent 9117050 commit 3e891f3
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 83 deletions.
Binary file removed DevContainers-AzureSQL.png
Binary file not shown.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ Streamlined development environments for Azure SQL Database using Dev Containers

## Overview

In the quest to enhance local development for Azure SQL Database, this repository provides a comprehensive solution using the power of Dev Containers. These templates offer developers a seamless and efficient development environment, enabling them to build applications for Azure SQL Database with ease and confidence. Dev Containers can be utilized in any development environment, including the cloud, promoting consistency across teams and workflows.
In the quest to enhance local development for Azure SQL Database, this repository provides a comprehensive solution using the power of dev containers. These templates offer developers a seamless and efficient development environment, enabling them to build applications for Azure SQL Database with ease and confidence. Dev containers can be utilized in any development environment, including the cloud, promoting consistency across teams and workflows.

![DevContainers-AzureSQL](DevContainers-AzureSQL.png)
![DevContainers-AzureSQL](azure-sql-db-dev-containers.png)

Our Dev Container templates simplify the development process by providing preconfigured environments that eliminate the need for manual setup. Developers can start coding immediately with all necessary tools and dependencies in place, using popular languages like `.NET` & `NET Aspire`, `Node.js`, `Python`.
Our development container templates for Azure SQL Database simplify the development process by providing preconfigured environments that eliminate the need for manual setup. Developers can start coding immediately with all necessary tools and dependencies in place, using popular languages like `.NET` & `NET Aspire`, `Node.js`, `Python`.

The local development environment mimics Azure SQL Database, allowing developers to manage data and test applications efficiently. Once ready, **GitHub Actions** automate the deployment process, transitioning seamlessly to **Azure Static Web Apps** and **Azure SQL Database**. This streamlined workflow enhances productivity, reduces setup time, and ensures consistency between local and production environments, helping developers deliver high-quality applications faster.

Expand All @@ -38,19 +38,19 @@ Developers face significant challenges in setting up efficient local development

### Addressing the Gap in Local Development Environments

We recognize the need for efficient local development environments tailored to Azure SQL Database. Our Dev Containers bridge this gap, enhancing developer experiences and fostering innovation within the Azure ecosystem. This initiative positions Azure SQL Database as a versatile and developer-centric platform.
We recognize the need for efficient local development environments tailored to Azure SQL Database. Our dev containers bridge this gap, enhancing developer experiences and fostering innovation within the Azure ecosystem. This initiative positions Azure SQL Database as a versatile and developer-centric platform.

### Accelerating Time-to-Market

Dev Containers streamline the development lifecycle, enabling developers to focus on coding and testing without the hassle of environment setup. The increased efficiency leads to faster iterations, higher-quality applications, and a reduced time-to-market for applications built on Azure SQL Database, giving businesses a competitive edge.
Dev containers streamline the development lifecycle, enabling developers to focus on coding and testing without the hassle of environment setup. The increased efficiency leads to faster iterations, higher-quality applications, and a reduced time-to-market for applications built on Azure SQL Database, giving businesses a competitive edge.

### Cost-Efficiency and Scalability

Local development with Dev Containers reduces cloud costs associated with development and testing in Azure environments. This optimization of resources improves cost-efficiency and scalability. Developers can transition seamlessly from local development to Azure environments, using the scalability and reliability of Azure SQL Database for production deployments without incurring unnecessary costs.
Local development with dev containers reduces cloud costs associated with development and testing in Azure environments. This optimization of resources improves cost-efficiency and scalability. Developers can transition seamlessly from local development to Azure environments, using the scalability and reliability of Azure SQL Database for production deployments without incurring unnecessary costs.

### Alignment with Cloud-Native Trends

Dev Containers support cloud-native development scenarios, aligning with modern application architectures and frameworks. Ensuring compatibility with Azure SQL Database and facilitates seamless deployment to Azure environments. By embracing cloud-native trends, we position Azure SQL Database as the platform of choice for modern, cloud-native applications, driving long-term adoption and revenue growth.
Dev containers support cloud-native development scenarios, aligning with modern application architectures and frameworks. Ensuring compatibility with Azure SQL Database and facilitates seamless deployment to Azure environments. By embracing cloud-native trends, we position Azure SQL Database as the platform of choice for modern, cloud-native applications, driving long-term adoption and revenue growth.

## Why Dev Containers, Docker, and VS Code?

Expand All @@ -62,7 +62,7 @@ Dev Containers, Docker, and VS Code are pivotal tools for modern developers:

## Value Proposition

Adopting Dev Containers for Azure SQL Database development offers several advantages:
Adopting dev containers for Azure SQL Database development offers several advantages:

- **Efficient Local Development**: Streamlines the setup process, saving time and reducing errors.
- **Cost-Efficiency**: Reduces cloud costs by enabling local development.
Expand All @@ -71,7 +71,7 @@ Adopting Dev Containers for Azure SQL Database development offers several advant

## Available Templates

This repository includes Dev Container templates for the following frameworks:
This repository includes Development Container Specifications (templates) for the following frameworks:

- .NET Aspire
- .NET 8
Expand All @@ -84,7 +84,7 @@ Each template comes with a preconfigured Azure SQL Database, making it easy to s

### Creating your own collection of templates

The [Dev Container Template specification](https://containers.dev/implementors/templates-distribution/#distribution) outlines a pattern for community members and organizations to self-author Templates in repositories they control.
The [Development Container Specification](https://containers.dev/implementors/templates-distribution/#distribution) outlines a pattern for community members and organizations to self-author Templates in repositories they control.

### Contributing to this repository

Expand Down
1 change: 0 additions & 1 deletion sqlcmd_location.log

This file was deleted.

2 changes: 1 addition & 1 deletion src/dotnet-aspire/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "2.0.0",
"tasks": [
{
"label": "Execute SQL Query",
"label": "Verify database schema and data",
"type": "shell",
"command": "code",
"args": [
Expand Down
35 changes: 19 additions & 16 deletions src/dotnet-aspire/NOTES.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

This Dev Container template enables you to effortlessly explore **.NET Aspire** and **Azure SQL**. In just a few simple steps, you can dive into the capabilities of these powerful technologies.
This dev container template enables you to effortlessly explore **.NET Aspire** and **Azure SQL**. In just a few simple steps, you can dive into the capabilities of these powerful technologies.

A **development container** (Dev Container for short) is a running [Docker](https://www.docker.com) container with a well-defined tool/runtime stack and its prerequisites. You can try out Dev Containers with **[GitHub Codespaces](https://github.com/features/codespaces)** or **[Visual Studio Code Dev Containers](https://aka.ms/vscode-remote/containers)**.
A **development container** (Dev Container for short) is a running [Docker](https://www.docker.com) container with a well-defined tool/runtime stack and its prerequisites. You can try out dev containers with **[GitHub Codespaces](https://github.com/features/codespaces)** or **[Visual Studio Code Dev Containers](https://aka.ms/vscode-remote/containers)**.

To learn more details about all the Azure SQL Database templates, you can explore the template repository at [aka.ms/azuresql-devcontainers](https://aka.ms/azuresql-devcontainers). This repository includes comprehensive information for each Azure SQL template. To learn more about Dev Containers, visit [containers.dev](https://containers.dev/) website, where you find a diverse range of templates.

> **Note:** If you already have a Codespace or Dev Container, you can jump to the [About this template](#about-this-template) section.
> **Note:**
> If you already have a Codespace or Dev Container, you can jump to the [About this template](#about-this-template) section.
## Setting up the development container

Expand All @@ -22,44 +23,45 @@ For more info, check out the [GitHub documentation](https://docs.github.com/en/f

Follow these steps to open this sample in a container using the VS Code Dev Containers extension:

1. If you're using a Dev Container for the first time, ensure your system meets the prerequisites in the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started).
1. If you're using a dev container for the first time, ensure your system meets the prerequisites in the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started).
2. To use this repository, you can either open the repository in an isolated Docker volume:
- Press `F1` or `Ctrl+Shift+P` to open the command palette.
- Select the **Dev Containers: New Dev Container** command.
- Select the desired Dev Container template for Azure SQL Database, typing `*Azure SQL*`.
- Select the desired dev container template for Azure SQL Database, typing `*Azure SQL*`.
- Select the **.NET with Aspire and Azure SQL (dotnet-aspire)** template
- Wait for the container to build.
- Visual Studio Code builds the container based on the selected configuration.
- The build process might take a few minutes the first time.
- Subsequent builds are faster.
- Once the container is built, the repository opens in the Dev Container.
- Once the container is built, the repository opens in the dev container.

> **Note:** Under the hood, this will use the **Dev Containers: Clone Repository in Container Volume...** command to clone the source code in a Docker volume instead of the local filesystem. [Volumes](https://docs.docker.com/storage/volumes/) are the preferred mechanism for persisting container data.
> **Note:**
> Under the hood, this will use the **Dev Containers: Clone Repository in Container Volume...** command to clone the source code in a Docker volume instead of the local filesystem. [Volumes](https://docs.docker.com/storage/volumes/) are the preferred mechanism for persisting container data.
### About this template

This Dev Container includes a preconfigured database, tailored for use with the Aspire component. This database serves as a foundation for demonstrating how the Aspire component interacts with Azure SQL.
This dev container includes a preconfigured database, tailored for use with the Aspire component. This database serves as a foundation for demonstrating how the Aspire component interacts with Azure SQL.

This template creates two containers, one for the Dev Container that includes .NET and Aspire, and one for Microsoft SQL Server. You're connected to the Ubuntu, and from within that container, the MS SQL container is available on **`localhost`** port 1433. The Dev Container also includes supporting scripts in the `.devcontainer/sql` folder used to configure the `Library` sample database.
This template creates two containers, one for the dev container that includes .NET and Aspire, and one for Microsoft SQL Server. You're connected to the Ubuntu, and from within that container, the MS SQL container is available on **`localhost`** port 1433. The dev container also includes supporting scripts in the `.devcontainer/sql` folder used to configure the `Library` sample database.

The SQL container is deployed from the latest developer edition of Microsoft SQL 2022. The database are made available directly in the Codespace/VS Code through the MSSQL extension with a connection labeled **LocalDev**. The default `sa` user password is set using the .devcontainer/.env file. In `.devcontainer/docker-compose.yml`, port `1433` is mapped as the default SQL Server port.
The SQL container is deployed from the latest developer edition of Microsoft SQL 2022. The database(s) are made available directly in the Codespace/VS Code through the MSSQL extension with a connection labeled **LocalDev**. The default sa user password is set using the `.devcontainer/.env` file. The default SQL port is mapped to port 1433 in `.devcontainer/docker-compose.yml`.

.NET Aspire is a cutting-edge framework crafted for developing cloud-native applications, with a primary focus on containerized environments. Aspire, built with .NET Core, empowers developers to architect scalable and resilient applications optimized for cloud deployment.

**Note:**
While the SQL Server container employs a standard version of SQL Server, all database development within this Dev Container can be validated for Azure SQL Database using the SQL Database Project. The SQL Database project is preconfigured with the target platform set as Azure SQL Database.
> **Note:**
> While the SQL Server container employs a standard version of SQL Server, all database development within this dev container can be validated for Azure SQL Database using the SQL Database Project. The SQL Database project is preconfigured with the target platform set as Azure SQL Database.
#### Visual Code Tasks

This Dev Container template includes multiple tasks that can help with common actions. You can access these tasks by opening the Command Palette in VS Code. Here's how:
This dev container template includes multiple tasks that can help with common actions. You can access these tasks by opening the Command Palette in VS Code. Here's how:

1. To open the Command Palette, press <kbd>F1</kbd> or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>.
2. Type "Run Task" and select "Tasks: Run Task".
3. Choose the task you want to run from the list.

##### Verify database schema and data

This task opens the `verifyDatabase.sql` file in your workspace and executes the SQL query using the `ms-mssql.mssql` extension. This task is optional however it can help you to become familiar with the sample `Library` database tables and data included in this Dev Container template.
This task opens the `verifyDatabase.sql` file in your workspace and executes the SQL query using the `ms-mssql.mssql` extension. This task is optional however it can help you to become familiar with the sample `Library` database tables and data included in this dev container template.

##### Build SQL Database project

Expand Down Expand Up @@ -111,7 +113,7 @@ The `postCreateCommand.sh` script handles the database deployment by performing

#### Using the SQL Database Projects Extension

You can use the SQL Database Projects extension to deploy the database schema. The Library.sqlproj project is located in the database/Library folder and can be built using the Build SQL Database project task. The output .dacpac files should be placed in the ./bin/Debug folder for deployment.
You can use the SQL Database Projects extension to deploy the database schema. The `Library.sqlproj` project is located in the `database/Library` folder and can be built using the Build SQL Database project task. The output .dacpac files should be placed in the `./bin/Debug` folder for deployment.

### Adding another service

Expand All @@ -131,6 +133,7 @@ This project uses the `5000` and `5001` ports for .NET Aspire, and the port `143
```json
"forwardPorts": [5000, 5001, 1433]
```
> **Note:** You can add additional ports to this list as needed.
> **Note:**
> You can add additional ports to this list as needed.

The `ports` property in `docker-compose.yml` [publishes](https://docs.docker.com/config/containers/container-networking/#published-ports) rather than forwards the port. This configuration couldn't work in a cloud environment like Codespaces and applications need to listen to `*` or `0.0.0.0` for the application to be accessible externally. Fortunately the `forwardPorts` property doesn't have this limitation.
2 changes: 1 addition & 1 deletion src/dotnet/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "2.0.0",
"tasks": [
{
"label": "Execute SQL Query",
"label": "Verify database schema and data",
"type": "shell",
"command": "code",
"args": [
Expand Down
Loading

0 comments on commit 3e891f3

Please sign in to comment.