├── .github
├── actions
│ └── smoke-test
│ │ ├── action.yaml
│ │ ├── build-dotnet-aspire.sh
│ │ ├── build-dotnet.sh
│ │ ├── build-javascript-node.sh
│ │ ├── build-python.sh
│ │ ├── test-dotnet-aspire.sh
│ │ ├── test-dotnet.sh
│ │ ├── test-javascript-node.sh
│ │ └── test-python.sh
└── workflows
│ ├── release.yaml
│ └── test-pr.yaml
├── LICENSE
├── README.md
├── SECURITY.md
├── azure-sql-db-dev-containers.png
├── src
├── dotnet-aspire
│ ├── .devcontainer
│ │ ├── .env
│ │ ├── Dockerfile
│ │ ├── devcontainer.json
│ │ ├── docker-compose.yml
│ │ └── sql
│ │ │ ├── installSQLtools.sh
│ │ │ └── postCreateCommand.sh
│ ├── .gitattributes
│ ├── .vscode
│ │ └── tasks.json
│ ├── NOTES.md
│ ├── README.md
│ ├── database
│ │ └── Library
│ │ │ ├── Library.sqlproj
│ │ │ ├── Sequences
│ │ │ └── globalId.sql
│ │ │ ├── StoredProcedures
│ │ │ └── stp_get_all_cowritten_books_by_author.sql
│ │ │ ├── Tables
│ │ │ ├── authors.sql
│ │ │ ├── books.sql
│ │ │ └── books_authors.sql
│ │ │ ├── Views
│ │ │ └── vw_books_details.sql
│ │ │ ├── bin
│ │ │ └── Debug
│ │ │ │ ├── Library.dacpac
│ │ │ │ ├── Library.dll
│ │ │ │ └── Library.pdb
│ │ │ ├── obj
│ │ │ ├── Debug
│ │ │ │ ├── Library.dll
│ │ │ │ ├── Library.pdb
│ │ │ │ ├── Library.sqlproj.FileListAbsolute.txt
│ │ │ │ ├── Model.xml
│ │ │ │ └── postdeploy.sql
│ │ │ ├── Library.sqlproj.nuget.dgspec.json
│ │ │ ├── Library.sqlproj.nuget.g.props
│ │ │ ├── Library.sqlproj.nuget.g.targets
│ │ │ ├── project.assets.json
│ │ │ └── project.nuget.cache
│ │ │ └── postDeployment.sql
│ ├── devcontainer-template.json
│ ├── images
│ │ ├── vscode-azure-sql-devcontainers-task-continue.png
│ │ ├── vscode-azure-sql-devcontainers-task-dotnet-aspire.png
│ │ ├── vscode-azure-sql-devcontainers-task-dotnet-cert.png
│ │ ├── vscode-azure-sql-devcontainers-task-list-dotnet-aspire.png
│ │ ├── vscode-azure-sql-devcontainers-task-project-build.png
│ │ ├── vscode-azure-sql-devcontainers-task-project-publish.png
│ │ ├── vscode-azure-sql-devcontainers-task-sql-profile.png
│ │ ├── vscode-azure-sql-devcontainers-task-sql-results.png
│ │ ├── vscode-azure-sql-devcontainers-task-sql-run.png
│ │ └── vscode-azure-sql-devcontainers-tasks.png
│ └── scripts
│ │ └── verifyDatabase.sql
├── dotnet
│ ├── .devcontainer
│ │ ├── .env
│ │ ├── Dockerfile
│ │ ├── devcontainer.json
│ │ ├── docker-compose.yml
│ │ └── sql
│ │ │ ├── installSQLtools.sh
│ │ │ └── postCreateCommand.sh
│ ├── .gitattributes
│ ├── .vscode
│ │ └── tasks.json
│ ├── NOTES.md
│ ├── README.md
│ ├── database
│ │ └── Library
│ │ │ ├── Library.sqlproj
│ │ │ ├── Sequences
│ │ │ └── globalId.sql
│ │ │ ├── StoredProcedures
│ │ │ └── stp_get_all_cowritten_books_by_author.sql
│ │ │ ├── Tables
│ │ │ ├── authors.sql
│ │ │ ├── books.sql
│ │ │ └── books_authors.sql
│ │ │ ├── Views
│ │ │ └── vw_books_details.sql
│ │ │ ├── bin
│ │ │ └── Debug
│ │ │ │ ├── Library.dacpac
│ │ │ │ ├── Library.dll
│ │ │ │ └── Library.pdb
│ │ │ ├── obj
│ │ │ ├── Debug
│ │ │ │ ├── Library.dll
│ │ │ │ ├── Library.pdb
│ │ │ │ ├── Library.sqlproj.FileListAbsolute.txt
│ │ │ │ ├── Model.xml
│ │ │ │ └── postdeploy.sql
│ │ │ ├── Library.sqlproj.nuget.dgspec.json
│ │ │ ├── Library.sqlproj.nuget.g.props
│ │ │ ├── Library.sqlproj.nuget.g.targets
│ │ │ ├── project.assets.json
│ │ │ └── project.nuget.cache
│ │ │ └── postDeployment.sql
│ ├── devcontainer-template.json
│ ├── images
│ │ ├── vscode-azure-sql-devcontainers-task-continue.png
│ │ ├── vscode-azure-sql-devcontainers-task-dotnet-cert.png
│ │ ├── vscode-azure-sql-devcontainers-task-list-dotnet.png
│ │ ├── vscode-azure-sql-devcontainers-task-project-build.png
│ │ ├── vscode-azure-sql-devcontainers-task-project-publish.png
│ │ ├── vscode-azure-sql-devcontainers-task-sql-profile.png
│ │ ├── vscode-azure-sql-devcontainers-task-sql-results.png
│ │ ├── vscode-azure-sql-devcontainers-task-sql-run.png
│ │ └── vscode-azure-sql-devcontainers-tasks.png
│ └── scripts
│ │ └── verifyDatabase.sql
├── javascript-node
│ ├── .devcontainer
│ │ ├── .env
│ │ ├── Dockerfile
│ │ ├── devcontainer.json
│ │ ├── docker-compose.yml
│ │ ├── dotnet
│ │ │ └── install-dotnet.sh
│ │ └── sql
│ │ │ ├── installSQLtools.sh
│ │ │ └── postCreateCommand.sh
│ ├── .gitattributes
│ ├── .vscode
│ │ └── tasks.json
│ ├── NOTES.md
│ ├── README.md
│ ├── database
│ │ └── Library
│ │ │ ├── Library.sqlproj
│ │ │ ├── Sequences
│ │ │ └── globalId.sql
│ │ │ ├── StoredProcedures
│ │ │ └── stp_get_all_cowritten_books_by_author.sql
│ │ │ ├── Tables
│ │ │ ├── authors.sql
│ │ │ ├── books.sql
│ │ │ └── books_authors.sql
│ │ │ ├── Views
│ │ │ └── vw_books_details.sql
│ │ │ ├── bin
│ │ │ └── Debug
│ │ │ │ ├── Library.dacpac
│ │ │ │ ├── Library.dll
│ │ │ │ └── Library.pdb
│ │ │ ├── obj
│ │ │ ├── Debug
│ │ │ │ ├── Library.dll
│ │ │ │ ├── Library.pdb
│ │ │ │ ├── Library.sqlproj.FileListAbsolute.txt
│ │ │ │ ├── Model.xml
│ │ │ │ └── postdeploy.sql
│ │ │ ├── Library.sqlproj.nuget.dgspec.json
│ │ │ ├── Library.sqlproj.nuget.g.props
│ │ │ ├── Library.sqlproj.nuget.g.targets
│ │ │ ├── project.assets.json
│ │ │ └── project.nuget.cache
│ │ │ └── postDeployment.sql
│ ├── devcontainer-template.json
│ ├── images
│ │ ├── vscode-azure-sql-devcontainers-task-continue.png
│ │ ├── vscode-azure-sql-devcontainers-task-list.png
│ │ ├── vscode-azure-sql-devcontainers-task-project-build.png
│ │ ├── vscode-azure-sql-devcontainers-task-project-publish.png
│ │ ├── vscode-azure-sql-devcontainers-task-sql-profile.png
│ │ ├── vscode-azure-sql-devcontainers-task-sql-results.png
│ │ ├── vscode-azure-sql-devcontainers-task-sql-run.png
│ │ └── vscode-azure-sql-devcontainers-tasks.png
│ └── scripts
│ │ └── verifyDatabase.sql
└── python
│ ├── .devcontainer
│ ├── .env
│ ├── Dockerfile
│ ├── devcontainer.json
│ ├── docker-compose.yml
│ ├── dotnet
│ │ └── install-dotnet.sh
│ └── sql
│ │ ├── installSQLtools.sh
│ │ └── postCreateCommand.sh
│ ├── .gitattributes
│ ├── .vscode
│ └── tasks.json
│ ├── NOTES.md
│ ├── README.md
│ ├── database
│ └── Library
│ │ ├── Library.sqlproj
│ │ ├── Sequences
│ │ └── globalId.sql
│ │ ├── StoredProcedures
│ │ └── stp_get_all_cowritten_books_by_author.sql
│ │ ├── Tables
│ │ ├── authors.sql
│ │ ├── books.sql
│ │ └── books_authors.sql
│ │ ├── Views
│ │ └── vw_books_details.sql
│ │ ├── bin
│ │ └── Debug
│ │ │ ├── Library.dacpac
│ │ │ ├── Library.dll
│ │ │ └── Library.pdb
│ │ ├── obj
│ │ ├── Debug
│ │ │ ├── Library.dll
│ │ │ ├── Library.pdb
│ │ │ ├── Library.sqlproj.FileListAbsolute.txt
│ │ │ ├── Model.xml
│ │ │ └── postdeploy.sql
│ │ ├── Library.sqlproj.nuget.dgspec.json
│ │ ├── Library.sqlproj.nuget.g.props
│ │ ├── Library.sqlproj.nuget.g.targets
│ │ ├── project.assets.json
│ │ └── project.nuget.cache
│ │ └── postDeployment.sql
│ ├── devcontainer-template.json
│ ├── images
│ ├── vscode-azure-sql-devcontainers-task-continue.png
│ ├── vscode-azure-sql-devcontainers-task-list.png
│ ├── vscode-azure-sql-devcontainers-task-project-build.png
│ ├── vscode-azure-sql-devcontainers-task-project-publish.png
│ ├── vscode-azure-sql-devcontainers-task-sql-profile.png
│ ├── vscode-azure-sql-devcontainers-task-sql-results.png
│ ├── vscode-azure-sql-devcontainers-task-sql-run.png
│ └── vscode-azure-sql-devcontainers-tasks.png
│ └── scripts
│ └── verifyDatabase.sql
└── test
├── dotnet-aspire
├── Program.cs
├── aspnetapp.csproj
├── obj
│ ├── Debug
│ │ └── net8.0
│ │ │ ├── .NETCoreApp,Version=v8.0.AssemblyAttributes.cs
│ │ │ ├── aspnetapp.AssemblyInfo.cs
│ │ │ ├── aspnetapp.AssemblyInfoInputs.cache
│ │ │ ├── aspnetapp.GeneratedMSBuildEditorConfig.editorconfig
│ │ │ ├── aspnetapp.assets.cache
│ │ │ └── aspnetapp.csproj.AssemblyReference.cache
│ ├── aspnetapp.csproj.nuget.dgspec.json
│ ├── aspnetapp.csproj.nuget.g.props
│ ├── aspnetapp.csproj.nuget.g.targets
│ ├── project.assets.json
│ └── project.nuget.cache
└── test.sh
├── dotnet
├── Program.cs
├── aspnetapp.csproj
├── bin
│ └── Debug
│ │ └── net8.0
│ │ ├── Azure.Core.dll
│ │ ├── Azure.Identity.dll
│ │ ├── Microsoft.Bcl.AsyncInterfaces.dll
│ │ ├── Microsoft.Data.SqlClient.dll
│ │ ├── Microsoft.Identity.Client.Extensions.Msal.dll
│ │ ├── Microsoft.Identity.Client.dll
│ │ ├── Microsoft.IdentityModel.JsonWebTokens.dll
│ │ ├── Microsoft.IdentityModel.Logging.dll
│ │ ├── Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
│ │ ├── Microsoft.IdentityModel.Protocols.dll
│ │ ├── Microsoft.IdentityModel.Tokens.dll
│ │ ├── Microsoft.Win32.SystemEvents.dll
│ │ ├── System.Configuration.ConfigurationManager.dll
│ │ ├── System.Drawing.Common.dll
│ │ ├── System.IdentityModel.Tokens.Jwt.dll
│ │ ├── System.Runtime.Caching.dll
│ │ ├── System.Security.Cryptography.ProtectedData.dll
│ │ ├── System.Security.Permissions.dll
│ │ ├── System.Windows.Extensions.dll
│ │ ├── aspnetapp
│ │ ├── aspnetapp.deps.json
│ │ ├── aspnetapp.dll
│ │ ├── aspnetapp.pdb
│ │ ├── aspnetapp.runtimeconfig.json
│ │ └── runtimes
│ │ ├── unix
│ │ └── lib
│ │ │ ├── netcoreapp3.0
│ │ │ └── System.Drawing.Common.dll
│ │ │ └── netcoreapp3.1
│ │ │ └── Microsoft.Data.SqlClient.dll
│ │ ├── win-arm
│ │ └── native
│ │ │ └── Microsoft.Data.SqlClient.SNI.dll
│ │ ├── win-arm64
│ │ └── native
│ │ │ └── Microsoft.Data.SqlClient.SNI.dll
│ │ ├── win-x64
│ │ └── native
│ │ │ └── Microsoft.Data.SqlClient.SNI.dll
│ │ ├── win-x86
│ │ └── native
│ │ │ └── Microsoft.Data.SqlClient.SNI.dll
│ │ └── win
│ │ └── lib
│ │ ├── netcoreapp3.0
│ │ ├── Microsoft.Win32.SystemEvents.dll
│ │ ├── System.Drawing.Common.dll
│ │ └── System.Windows.Extensions.dll
│ │ ├── netcoreapp3.1
│ │ └── Microsoft.Data.SqlClient.dll
│ │ └── netstandard2.0
│ │ ├── System.Runtime.Caching.dll
│ │ └── System.Security.Cryptography.ProtectedData.dll
├── obj
│ ├── Debug
│ │ └── net8.0
│ │ │ ├── .NETCoreApp,Version=v8.0.AssemblyAttributes.cs
│ │ │ ├── apphost
│ │ │ ├── aspnetapp.AssemblyInfo.cs
│ │ │ ├── aspnetapp.AssemblyInfoInputs.cache
│ │ │ ├── aspnetapp.GeneratedMSBuildEditorConfig.editorconfig
│ │ │ ├── aspnetapp.MvcApplicationPartsAssemblyInfo.cache
│ │ │ ├── aspnetapp.assets.cache
│ │ │ ├── aspnetapp.csproj.AssemblyReference.cache
│ │ │ ├── aspnetapp.csproj.CoreCompileInputs.cache
│ │ │ ├── aspnetapp.csproj.FileListAbsolute.txt
│ │ │ ├── aspnetapp.csproj.Up2Date
│ │ │ ├── aspnetapp.dll
│ │ │ ├── aspnetapp.genruntimeconfig.cache
│ │ │ ├── aspnetapp.pdb
│ │ │ ├── aspnetapp.sourcelink.json
│ │ │ ├── ref
│ │ │ └── aspnetapp.dll
│ │ │ ├── refint
│ │ │ └── aspnetapp.dll
│ │ │ ├── staticwebassets.build.json
│ │ │ └── staticwebassets
│ │ │ ├── msbuild.build.aspnetapp.props
│ │ │ ├── msbuild.buildMultiTargeting.aspnetapp.props
│ │ │ └── msbuild.buildTransitive.aspnetapp.props
│ ├── aspnetapp.csproj.nuget.dgspec.json
│ ├── aspnetapp.csproj.nuget.g.props
│ ├── aspnetapp.csproj.nuget.g.targets
│ ├── project.assets.json
│ └── project.nuget.cache
└── test.sh
├── javascript-node
├── .env
├── eslint.config.js
├── index.js
├── package.json
└── test.sh
├── python
├── requirements.txt
├── test.sh
└── test_sql_connection.py
└── test-utils
├── Library.sql
├── test-utils.sh
├── tests-by-template.sh
└── troubleshooting.sh
/.github/actions/smoke-test/action.yaml:
--------------------------------------------------------------------------------
1 | name: 'Smoke test'
2 | inputs:
3 | template:
4 | description: 'Template to test'
5 | required: true
6 |
7 | runs:
8 | using: composite
9 | steps:
10 | - name: Checkout main
11 | id: checkout_release
12 | uses: actions/checkout@v3
13 |
14 | - name: Build template
15 | id: build_template
16 | shell: bash
17 | run: ${{ github.action_path }}/build.sh ${{ inputs.template }}
18 |
19 | - name: Test template
20 | id: test_template
21 | shell: bash
22 | run: ${{ github.action_path }}/test.sh ${{ inputs.template }}
--------------------------------------------------------------------------------
/.github/actions/smoke-test/build-dotnet-aspire.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | TEMPLATE_ID="$1"
3 |
4 | set -e
5 |
6 | shopt -s dotglob
7 |
8 | SRC_DIR="/tmp/${TEMPLATE_ID}"
9 | cp -R "src/${TEMPLATE_ID}" "${SRC_DIR}"
10 |
11 | pushd "${SRC_DIR}"
12 |
13 | # Configure templates only if `devcontainer-template.json` contains the `options` property.
14 | OPTION_PROPERTY=( $(jq -r '.options' devcontainer-template.json) )
15 |
16 | if [ "${OPTION_PROPERTY}" != "" ] && [ "${OPTION_PROPERTY}" != "null" ] ; then
17 | OPTIONS=( $(jq -r '.options | keys[]' devcontainer-template.json) )
18 |
19 | if [ "${OPTIONS[0]}" != "" ] && [ "${OPTIONS[0]}" != "null" ] ; then
20 | echo "(!) Configuring template options for '${TEMPLATE_ID}'"
21 | for OPTION in "${OPTIONS[@]}"
22 | do
23 | OPTION_KEY="\${templateOption:$OPTION}"
24 | OPTION_VALUE=$(jq -r ".options | .${OPTION} | .default" devcontainer-template.json)
25 |
26 | if [ "${OPTION_VALUE}" = "" ] || [ "${OPTION_VALUE}" = "null" ] ; then
27 | echo "Template '${TEMPLATE_ID}' is missing a default value for option '${OPTION}'"
28 | exit 1
29 | fi
30 |
31 | echo "(!) Replacing '${OPTION_KEY}' with '${OPTION_VALUE}'"
32 | OPTION_VALUE_ESCAPED=$(sed -e 's/[]\/$*.^[]/\\&/g' <<<"${OPTION_VALUE}")
33 | find ./ -type f -print0 | xargs -0 sed -i "s/${OPTION_KEY}/${OPTION_VALUE_ESCAPED}/g"
34 | done
35 | fi
36 | fi
37 |
38 | popd
39 |
40 | TEST_DIR="test/${TEMPLATE_ID}"
41 | if [ -d "${TEST_DIR}" ] ; then
42 | echo "(*) Copying test folder"
43 | DEST_DIR="${SRC_DIR}/dotnet-aspire"
44 | mkdir -p ${DEST_DIR}
45 | cp -Rp ${TEST_DIR}/* ${DEST_DIR}
46 | cp test/test-utils/test-utils.sh ${DEST_DIR}
47 | fi
48 |
49 | export DOCKER_BUILDKIT=1
50 | echo "(*) Installing @devcontainer/cli"
51 | npm install -g @devcontainers/cli
52 |
53 | echo "Building Dev Container"
54 | ID_LABEL="test-container=${TEMPLATE_ID}"
55 | devcontainer up --id-label ${ID_LABEL} --workspace-folder "${SRC_DIR}"
--------------------------------------------------------------------------------
/.github/actions/smoke-test/build-dotnet.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | TEMPLATE_ID="$1"
3 |
4 | set -e
5 |
6 | shopt -s dotglob
7 |
8 | SRC_DIR="/tmp/${TEMPLATE_ID}"
9 | cp -R "src/${TEMPLATE_ID}" "${SRC_DIR}"
10 |
11 | pushd "${SRC_DIR}"
12 |
13 | # Configure templates only if `devcontainer-template.json` contains the `options` property.
14 | OPTION_PROPERTY=( $(jq -r '.options' devcontainer-template.json) )
15 |
16 | if [ "${OPTION_PROPERTY}" != "" ] && [ "${OPTION_PROPERTY}" != "null" ] ; then
17 | OPTIONS=( $(jq -r '.options | keys[]' devcontainer-template.json) )
18 |
19 | if [ "${OPTIONS[0]}" != "" ] && [ "${OPTIONS[0]}" != "null" ] ; then
20 | echo "(!) Configuring template options for '${TEMPLATE_ID}'"
21 | for OPTION in "${OPTIONS[@]}"
22 | do
23 | OPTION_KEY="\${templateOption:$OPTION}"
24 | OPTION_VALUE=$(jq -r ".options | .${OPTION} | .default" devcontainer-template.json)
25 |
26 | if [ "${OPTION_VALUE}" = "" ] || [ "${OPTION_VALUE}" = "null" ] ; then
27 | echo "Template '${TEMPLATE_ID}' is missing a default value for option '${OPTION}'"
28 | exit 1
29 | fi
30 |
31 | echo "(!) Replacing '${OPTION_KEY}' with '${OPTION_VALUE}'"
32 | OPTION_VALUE_ESCAPED=$(sed -e 's/[]\/$*.^[]/\\&/g' <<<"${OPTION_VALUE}")
33 | find ./ -type f -print0 | xargs -0 sed -i "s/${OPTION_KEY}/${OPTION_VALUE_ESCAPED}/g"
34 | done
35 | fi
36 | fi
37 |
38 | popd
39 |
40 | TEST_DIR="test/${TEMPLATE_ID}"
41 | if [ -d "${TEST_DIR}" ] ; then
42 | echo "(*) Copying test folder"
43 | DEST_DIR="${SRC_DIR}/dotnet"
44 | mkdir -p ${DEST_DIR}
45 | cp -Rp ${TEST_DIR}/* ${DEST_DIR}
46 | cp test/test-utils/test-utils.sh ${DEST_DIR}
47 | fi
48 |
49 | export DOCKER_BUILDKIT=1
50 | echo "(*) Installing @devcontainer/cli"
51 | npm install -g @devcontainers/cli
52 |
53 | echo "Building Dev Container"
54 | ID_LABEL="test-container=${TEMPLATE_ID}"
55 | devcontainer up --id-label ${ID_LABEL} --workspace-folder "${SRC_DIR}"
--------------------------------------------------------------------------------
/.github/actions/smoke-test/build-javascript-node.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | TEMPLATE_ID="$1"
3 |
4 | set -e
5 |
6 | shopt -s dotglob
7 |
8 | SRC_DIR="/tmp/${TEMPLATE_ID}"
9 | cp -R "src/${TEMPLATE_ID}" "${SRC_DIR}"
10 |
11 | pushd "${SRC_DIR}"
12 |
13 | # Configure templates only if `devcontainer-template.json` contains the `options` property.
14 | OPTION_PROPERTY=( $(jq -r '.options' devcontainer-template.json) )
15 |
16 | if [ "${OPTION_PROPERTY}" != "" ] && [ "${OPTION_PROPERTY}" != "null" ] ; then
17 | OPTIONS=( $(jq -r '.options | keys[]' devcontainer-template.json) )
18 |
19 | if [ "${OPTIONS[0]}" != "" ] && [ "${OPTIONS[0]}" != "null" ] ; then
20 | echo "(!) Configuring template options for '${TEMPLATE_ID}'"
21 | for OPTION in "${OPTIONS[@]}"
22 | do
23 | OPTION_KEY="\${templateOption:$OPTION}"
24 | OPTION_VALUE=$(jq -r ".options | .${OPTION} | .default" devcontainer-template.json)
25 |
26 | if [ "${OPTION_VALUE}" = "" ] || [ "${OPTION_VALUE}" = "null" ] ; then
27 | echo "Template '${TEMPLATE_ID}' is missing a default value for option '${OPTION}'"
28 | exit 1
29 | fi
30 |
31 | echo "(!) Replacing '${OPTION_KEY}' with '${OPTION_VALUE}'"
32 | OPTION_VALUE_ESCAPED=$(sed -e 's/[]\/$*.^[]/\\&/g' <<<"${OPTION_VALUE}")
33 | find ./ -type f -print0 | xargs -0 sed -i "s/${OPTION_KEY}/${OPTION_VALUE_ESCAPED}/g"
34 | done
35 | fi
36 | fi
37 |
38 | popd
39 |
40 | TEST_DIR="test/${TEMPLATE_ID}"
41 | if [ -d "${TEST_DIR}" ] ; then
42 | echo "(*) Copying test folder"
43 | DEST_DIR="${SRC_DIR}/javascript-node"
44 | mkdir -p ${DEST_DIR}
45 | cp -Rp ${TEST_DIR}/* ${DEST_DIR}
46 | cp test/test-utils/test-utils.sh ${DEST_DIR}
47 | fi
48 |
49 | export DOCKER_BUILDKIT=1
50 | echo "(*) Installing @devcontainer/cli"
51 | npm install -g @devcontainers/cli
52 |
53 | echo "Building Dev Container"
54 | ID_LABEL="test-container=${TEMPLATE_ID}"
55 | devcontainer up --id-label ${ID_LABEL} --workspace-folder "${SRC_DIR}"
--------------------------------------------------------------------------------
/.github/actions/smoke-test/build-python.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | TEMPLATE_ID="$1"
3 |
4 | set -e
5 |
6 | shopt -s dotglob
7 |
8 | SRC_DIR="/tmp/${TEMPLATE_ID}"
9 | cp -R "src/${TEMPLATE_ID}" "${SRC_DIR}"
10 |
11 | pushd "${SRC_DIR}"
12 |
13 | # Configure templates only if `devcontainer-template.json` contains the `options` property.
14 | OPTION_PROPERTY=( $(jq -r '.options' devcontainer-template.json) )
15 |
16 | if [ "${OPTION_PROPERTY}" != "" ] && [ "${OPTION_PROPERTY}" != "null" ] ; then
17 | OPTIONS=( $(jq -r '.options | keys[]' devcontainer-template.json) )
18 |
19 | if [ "${OPTIONS[0]}" != "" ] && [ "${OPTIONS[0]}" != "null" ] ; then
20 | echo "(!) Configuring template options for '${TEMPLATE_ID}'"
21 | for OPTION in "${OPTIONS[@]}"
22 | do
23 | OPTION_KEY="\${templateOption:$OPTION}"
24 | OPTION_VALUE=$(jq -r ".options | .${OPTION} | .default" devcontainer-template.json)
25 |
26 | if [ "${OPTION_VALUE}" = "" ] || [ "${OPTION_VALUE}" = "null" ] ; then
27 | echo "Template '${TEMPLATE_ID}' is missing a default value for option '${OPTION}'"
28 | exit 1
29 | fi
30 |
31 | echo "(!) Replacing '${OPTION_KEY}' with '${OPTION_VALUE}'"
32 | OPTION_VALUE_ESCAPED=$(sed -e 's/[]\/$*.^[]/\\&/g' <<<"${OPTION_VALUE}")
33 | find ./ -type f -print0 | xargs -0 sed -i "s/${OPTION_KEY}/${OPTION_VALUE_ESCAPED}/g"
34 | done
35 | fi
36 | fi
37 |
38 | popd
39 |
40 | TEST_DIR="test/${TEMPLATE_ID}"
41 | if [ -d "${TEST_DIR}" ] ; then
42 | echo "(*) Copying test folder"
43 | DEST_DIR="${SRC_DIR}/python"
44 | mkdir -p ${DEST_DIR}
45 | cp -Rp ${TEST_DIR}/* ${DEST_DIR}
46 | cp test/test-utils/test-utils.sh ${DEST_DIR}
47 | fi
48 |
49 | export DOCKER_BUILDKIT=1
50 | echo "(*) Installing @devcontainer/cli"
51 | npm install -g @devcontainers/cli
52 |
53 | echo "Building Dev Container"
54 | ID_LABEL="test-container=${TEMPLATE_ID}"
55 | devcontainer up --id-label ${ID_LABEL} --workspace-folder "${SRC_DIR}"
--------------------------------------------------------------------------------
/.github/actions/smoke-test/test-dotnet-aspire.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | TEMPLATE_ID="$1"
3 | set -e
4 |
5 | SRC_DIR="/tmp/${TEMPLATE_ID}"
6 | echo "Running Smoke Test"
7 |
8 | ID_LABEL="test-container=${TEMPLATE_ID}"
9 | devcontainer exec --workspace-folder "${SRC_DIR}" --id-label ${ID_LABEL} /bin/sh -c 'set -e && if [ -f "dotnet-aspire/test.sh" ]; then cd dotnet-aspire && if [ "$(id -u)" = "0" ]; then chmod +x test.sh; else sudo chmod +x test.sh; fi && ./test.sh; else ls -a; fi'
10 |
11 | # Clean up
12 | docker rm -f $(docker container ls -f "label=${ID_LABEL}" -q)
13 | rm -rf "${SRC_DIR}"
--------------------------------------------------------------------------------
/.github/actions/smoke-test/test-dotnet.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | TEMPLATE_ID="$1"
3 | set -e
4 |
5 | SRC_DIR="/tmp/${TEMPLATE_ID}"
6 | echo "Running Smoke Test"
7 |
8 | ID_LABEL="test-container=${TEMPLATE_ID}"
9 | devcontainer exec --workspace-folder "${SRC_DIR}" --id-label ${ID_LABEL} /bin/sh -c 'set -e && if [ -f "dotnet/test.sh" ]; then cd dotnet && if [ "$(id -u)" = "0" ]; then chmod +x test.sh; else sudo chmod +x test.sh; fi && ./test.sh; else ls -a; fi'
10 |
11 | # Clean up
12 | docker rm -f $(docker container ls -f "label=${ID_LABEL}" -q)
13 | rm -rf "${SRC_DIR}"
--------------------------------------------------------------------------------
/.github/actions/smoke-test/test-javascript-node.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | TEMPLATE_ID="$1"
3 | set -e
4 |
5 | SRC_DIR="/tmp/${TEMPLATE_ID}"
6 | echo "Running Smoke Test"
7 |
8 | ID_LABEL="test-container=${TEMPLATE_ID}"
9 | devcontainer exec --workspace-folder "${SRC_DIR}" --id-label ${ID_LABEL} /bin/sh -c 'set -e && if [ -f "javascript-node/test.sh" ]; then cd javascript-node && if [ "$(id -u)" = "0" ]; then chmod +x test.sh; else sudo chmod +x test.sh; fi && ./test.sh; else ls -a; fi'
10 |
11 | # Clean up
12 | docker rm -f $(docker container ls -f "label=${ID_LABEL}" -q)
13 | rm -rf "${SRC_DIR}"
--------------------------------------------------------------------------------
/.github/actions/smoke-test/test-python.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | TEMPLATE_ID="$1"
3 | set -e
4 |
5 | SRC_DIR="/tmp/${TEMPLATE_ID}"
6 | echo "Running Smoke Test"
7 |
8 | ID_LABEL="test-container=${TEMPLATE_ID}"
9 | devcontainer exec --workspace-folder "${SRC_DIR}" --id-label ${ID_LABEL} /bin/sh -c 'set -e && if [ -f "python/test.sh" ]; then cd python && if [ "$(id -u)" = "0" ]; then chmod +x test.sh; else sudo chmod +x test.sh; fi && ./test.sh; else ls -a; fi'
10 |
11 | # Clean up
12 | docker rm -f $(docker container ls -f "label=${ID_LABEL}" -q)
13 | rm -rf "${SRC_DIR}"
--------------------------------------------------------------------------------
/.github/workflows/release.yaml:
--------------------------------------------------------------------------------
1 | name: "Release Dev Container Templates & Generate Documentation"
2 | on:
3 | workflow_dispatch:
4 |
5 | jobs:
6 | deploy:
7 | permissions:
8 | packages: write
9 | contents: write
10 | pull-requests: write
11 | if: ${{ github.ref == 'refs/heads/main' }}
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/checkout@v3
15 |
16 | - name: "Publish Templates"
17 | uses: devcontainers/action@v1
18 | with:
19 | publish-templates: "true"
20 | base-path-to-templates: "./src"
21 | generate-docs: "true"
22 | env:
23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 |
25 | - name: Create a PR for Documentation
26 | id: push_image_info
27 | env:
28 | GITHUB_TOKEN: ${{ secrets.PAT }}
29 | run: |
30 | set -e
31 | echo "Start."
32 |
33 | # Configure git and Push updates
34 | git config --global user.email github-actions@github.com
35 | git config --global user.name github-actions
36 | git config pull.rebase false
37 |
38 | branch=automated-documentation-update-$GITHUB_RUN_ID
39 | git checkout -b $branch
40 | message='Automated documentation update'
41 |
42 | # Add / update and commit
43 | git add */**/README.md
44 | git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
45 |
46 | # Push
47 | if [ "$NO_UPDATES" != "true" ] ; then
48 | git push origin "$branch"
49 | gh api \
50 | --method POST \
51 | -H "Accept: application/vnd.github+json" \
52 | /repos/${GITHUB_REPOSITORY}/pulls \
53 | -f title="$message" \
54 | -f body="$message" \
55 | -f head="$branch" \
56 | -f base='main'
57 | fi
58 |
--------------------------------------------------------------------------------
/.github/workflows/test-pr.yaml:
--------------------------------------------------------------------------------
1 | name: "CI - Test Templates"
2 | on:
3 | pull_request:
4 |
5 | jobs:
6 | detect-changes:
7 | runs-on: ubuntu-latest
8 | outputs:
9 | templates: ${{ steps.filter.outputs.changes }}
10 | steps:
11 | - uses: dorny/paths-filter@v2
12 | id: filter
13 | with:
14 | filters: |
15 | dab-mssql: ./**/dab-mssql/**
16 |
17 | test:
18 | needs: [detect-changes]
19 | runs-on: ubuntu-latest
20 | continue-on-error: true
21 | strategy:
22 | matrix:
23 | templates: ${{ fromJSON(needs.detect-changes.outputs.templates) }}
24 | steps:
25 | - uses: actions/checkout@v3
26 |
27 | - name: Smoke test for '${{ matrix.templates }}'
28 | id: smoke_test
29 | uses: ./.github/actions/smoke-test
30 | with:
31 | template: "${{ matrix.templates }}"
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Microsoft
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Azure SQL Database Dev Container Templates
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | |
10 |
11 | Azure SQL Database Dev Container Templates
12 | Streamlined development environments for Azure SQL Database using Dev Containers.
13 | |
14 |
15 |
16 |
17 |
18 | ## Overview
19 |
20 | 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.
21 |
22 | 
23 |
24 | 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`.
25 |
26 | 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.
27 |
28 | Thank you for joining us on this journey to enhance the Azure SQL Database development experience. We look forward to your feedback and contributions!
29 |
30 | ## Problem Statement
31 |
32 | Developers face significant challenges in setting up efficient local development environments for Azure SQL Database:
33 |
34 | - **Lack of Compatibility**: Discrepancies between local development and production environments.
35 | - **Setup Complexity**: Time-consuming manual installations and configurations.
36 | - **Dependency on Cloud Resources**: Increased cloud costs and reliance on internet connectivity.
37 | - **Limited Integration**: Lack of integration with existing Azure development tools.
38 |
39 | ### Addressing the Gap in Local Development Environments
40 |
41 | 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.
42 |
43 | ### Accelerating Time-to-Market
44 |
45 | 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.
46 |
47 | ### Cost-Efficiency and Scalability
48 |
49 | 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.
50 |
51 | ### Alignment with Cloud-Native Trends
52 |
53 | 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.
54 |
55 | ## Why Dev Containers, Docker, and VS Code?
56 |
57 | Dev Containers, Docker, and VS Code are pivotal tools for modern developers:
58 |
59 | - **Docker**: Provides portable and reproducible environments.
60 | - **VS Code**: Popular IDE with robust features and extensibility.
61 | - **Dev Containers**: Offer a seamless transition from local development to Azure environments, reducing setup complexity and promoting efficiency.
62 |
63 | ## Value Proposition
64 |
65 | Adopting dev containers for Azure SQL Database development offers several advantages:
66 |
67 | - **Efficient Local Development**: Streamlines the setup process, saving time and reducing errors.
68 | - **Cost-Efficiency**: Reduces cloud costs by enabling local development.
69 | - **Faster Time-to-Market**: Accelerates development cycles, leading to quicker application releases.
70 | - **Alignment with Cloud-Native Trends**: Supports modern application architectures and frameworks.
71 |
72 | ## Available Templates
73 |
74 | This repository includes Development Container Specifications (templates) for the following frameworks:
75 |
76 | - .NET Aspire
77 | - .NET 8
78 | - Node.js (JavaScript)
79 | - Python
80 |
81 | Each template comes with a preconfigured Azure SQL Database, making it easy to start developing right away.
82 |
83 | ## Contributions
84 |
85 | ### Creating your own collection of templates
86 |
87 | 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.
88 |
89 | ### Contributing to this repository
90 |
91 | This repository accepts improvement and bug fix contributions related to the
92 | [current set of maintained templates](./src).
93 |
94 | ## Feedback
95 |
96 | Issues related to these templates can be reported in [an issue](https://github.com/microsoft/azuresql-devcontainers/issues) in this repository.
97 |
98 | # License
99 |
100 | Copyright (c) Microsoft Corporation. All rights reserved.
101 | Licensed under the MIT License. See [LICENSE](LICENSE).
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Security
4 |
5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
6 |
7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
8 |
9 | ## Reporting Security Issues
10 |
11 | **Please do not report security vulnerabilities through public GitHub issues.**
12 |
13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
14 |
15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16 |
17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18 |
19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20 |
21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22 | * Full paths of source file(s) related to the manifestation of the issue
23 | * The location of the affected source code (tag/branch/commit or direct URL)
24 | * Any special configuration required to reproduce the issue
25 | * Step-by-step instructions to reproduce the issue
26 | * Proof-of-concept or exploit code (if possible)
27 | * Impact of the issue, including how an attacker might exploit the issue
28 |
29 | This information will help us triage your report more quickly.
30 |
31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
32 |
33 | ## Preferred Languages
34 |
35 | We prefer all communications to be in English.
36 |
37 | ## Policy
38 |
39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
40 |
41 |
42 |
--------------------------------------------------------------------------------
/azure-sql-db-dev-containers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/azure-sql-db-dev-containers.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/.devcontainer/.env:
--------------------------------------------------------------------------------
1 | MSSQL_SA_PASSWORD=P@ssw0rd!
--------------------------------------------------------------------------------
/src/dotnet-aspire/.devcontainer/Dockerfile:
--------------------------------------------------------------------------------
1 | # [Choice] .NET version: 8.0-bookworm, 8.0-jammy, 8.0-bullseye
2 | FROM mcr.microsoft.com/devcontainers/dotnet:1-${templateOption:imageVariant}
3 |
4 | # Add .NET global tools path
5 | ENV PATH $PATH:/home/vscode/.dotnet:/home/vscode/.dotnet/tools
6 |
7 | # [Optional] Uncomment this section to install additional OS packages.
8 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9 | && apt-get -y install --no-install-recommends software-properties-common
10 |
11 | # Install SQL Tools: SQLPackage and sqlcmd
12 | COPY sql/installSQLtools.sh installSQLtools.sh
13 | RUN bash ./installSQLtools.sh \
14 | && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
15 |
16 | # Update .NET workload and install .NET Aspire
17 | RUN sudo dotnet workload update \
18 | && sudo dotnet workload install aspire
--------------------------------------------------------------------------------
/src/dotnet-aspire/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // For format details, see https://aka.ms/devcontainer.json.
2 | // For config options, see the README at: https://github.com/microsoft/azuresql-devcontainers/tree/main/src/dotnet-aspire
3 | {
4 | "name": ".NET with Aspire and Azure SQL",
5 | "dockerComposeFile": "docker-compose.yml",
6 | "service": "app",
7 | "workspaceFolder": "/workspace",
8 | "customizations": {
9 | // Configure properties specific to VS Code.
10 | "vscode": {
11 | // Set *default* container specific settings.json values on container create.
12 | "settings": {
13 | "mssql.connections": [
14 | {
15 | "server": "localhost,1433",
16 | "database": "master",
17 | "authenticationType": "SqlLogin",
18 | "user": "sa",
19 | "password": "${env:MSSQL_SA_PASSWORD}",
20 | "savePassword": true,
21 | "profileName": "LocalDev",
22 | "trustServerCertificate": true
23 | }
24 | ],
25 | "sqlDatabaseProjects.dotnetSDK Location": "/usr/share/dotnet"
26 | },
27 | // Add the IDs of extensions you want installed when the container is created.
28 | "extensions": [
29 | "ms-dotnettools.csdevkit",
30 | "ms-dotnettools.csharp",
31 | "ms-azuretools.vscode-bicep",
32 | "ms-mssql.mssql",
33 | "ms-azuretools.vscode-docker",
34 | "github.copilot",
35 | "github.codespaces"
36 | ]
37 | }
38 | },
39 |
40 | // Use 'forwardPorts' to make a list of ports inside the container available locally.
41 | "forwardPorts": [5000, 5001, 8000, 1433],
42 |
43 | // Post create commands to run after the container is created.
44 | "postCreateCommand": "bash .devcontainer/sql/postCreateCommand.sh 'database/Library/bin/Debug'",
45 |
46 | // Post start commands to run after the container is started.
47 |
48 |
49 | // Features to add to the dev container. More info: https://containers.dev/features.
50 | "features": {
51 | "ghcr.io/devcontainers/features/azure-cli:1": {
52 | "installBicep": true,
53 | "installUsingPython": true,
54 | "version": "latest"
55 | },
56 | "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
57 | "version": "latest"
58 | },
59 | "ghcr.io/azure/azure-dev/azd:latest": {
60 | "version": "latest"
61 | }
62 | }
63 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
64 | // "remoteUser": "root"
65 |
66 | }
--------------------------------------------------------------------------------
/src/dotnet-aspire/.devcontainer/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 | app:
5 | build:
6 | context: .
7 | dockerfile: Dockerfile
8 |
9 | volumes:
10 | - ..:/workspace:cached
11 |
12 | # Overrides default command so things don't shut down after the process ends.
13 | command: sleep infinity
14 |
15 | # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
16 | network_mode: service:db
17 | # Uncomment the next line to use a non-root user for all processes.
18 | # user: vscode
19 |
20 | # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
21 | # (Adding the "ports" property to this file will not forward from a Codespace.)
22 |
23 | db:
24 | image: mcr.microsoft.com/azure-sql-edge
25 | hostname: SQL-Library
26 | container_name: SQL-Library
27 | restart: unless-stopped
28 | environment:
29 | ACCEPT_EULA: Y
30 | env_file:
31 | - .env
32 | deploy:
33 | resources:
34 | limits:
35 | cpus: '1'
36 | memory: 2048M
37 | # Add "forwardPorts": ["1433"] to **devcontainer.json** to forward MSSQL locally.
38 | # (Adding the "ports" property to this file will not forward from a Codespace.)
--------------------------------------------------------------------------------
/src/dotnet-aspire/.devcontainer/sql/installSQLtools.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Installing Go-SQLCmd ..."
4 | curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
5 | sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/prod.list)"
6 | sudo apt-get update
7 | sudo apt-get install -y sqlcmd
8 | echo "Go-SQLCmd installed."
9 |
10 | echo "Installing Sqlpackage ..."
11 | curl -sSL -o sqlpackage.zip "https://aka.ms/sqlpackage-linux"
12 | mkdir -p /opt/sqlpackage
13 | unzip sqlpackage.zip -d /opt/sqlpackage && rm sqlpackage.zip
14 | chmod a+x /opt/sqlpackage/sqlpackage
15 | echo "Sqlpackage installed."
--------------------------------------------------------------------------------
/src/dotnet-aspire/.devcontainer/sql/postCreateCommand.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Setting variables
4 | dacpac="false"
5 |
6 | # Load SA_PASSWORD from .env file
7 | export $(grep -v '^#' .devcontainer/.env | xargs)
8 | SApassword=$MSSQL_SA_PASSWORD
9 |
10 | # Parameters
11 | dacpath=$1
12 |
13 | # Extract the project directory from the dacpath
14 | projectDir=$(echo $dacpath | cut -d'/' -f1-2)
15 |
16 | echo "SELECT * FROM SYS.DATABASES" | dd of=testsqlconnection.sql
17 | for i in {1..30};
18 | do
19 | sqlcmd -S localhost -U sa -P $SApassword -d master -i testsqlconnection.sql > /dev/null
20 | if [ $? -eq 0 ]
21 | then
22 | echo "SQL server ready"
23 | break
24 | else
25 | echo "Not ready yet..."
26 | sleep 1
27 | fi
28 | done
29 | rm testsqlconnection.sql
30 |
31 | for f in $dacpath/*
32 | do
33 | if [ $f == $dacpath/*".dacpac" ]
34 | then
35 | dacpac="true"
36 | echo "Found dacpac $f"
37 | fi
38 | done
39 |
40 | if [ $dacpac == "true" ]
41 | then
42 | # Build the SQL Database project
43 | echo "Building SQL Database project at $projectDir..."
44 | dotnet build $projectDir
45 |
46 | for f in $dacpath/*
47 | do
48 | if [ $f == $dacpath/*".dacpac" ]
49 | then
50 | dbname=$(basename $f ".dacpac")
51 | # Deploy the dacpac
52 | echo "Deploying dacpac $f"
53 | /opt/sqlpackage/sqlpackage /Action:Publish /SourceFile:$f /TargetServerName:localhost /TargetDatabaseName:$dbname /TargetUser:sa /TargetPassword:$SApassword /TargetTrustServerCertificate:True
54 | fi
55 | done
56 | fi
--------------------------------------------------------------------------------
/src/dotnet-aspire/.gitattributes:
--------------------------------------------------------------------------------
1 | # Git will always convert line endings to LF on checkout.
2 | # Used for files that must keep LF endings, even on Windows.
3 | *.sh text eol=lf
--------------------------------------------------------------------------------
/src/dotnet-aspire/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the tasks.json format
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "label": "1. Verify database schema and data",
8 | "type": "shell",
9 | "command": "code",
10 | "args": [
11 | "--goto",
12 | "${workspaceFolder}/scripts/verifyDatabase.sql"
13 | ],
14 | "presentation": {
15 | "reveal": "always",
16 | "panel": "new"
17 | }
18 | },
19 | {
20 | "label": "2. Build SQL Database project",
21 | "type": "shell",
22 | "command": "dotnet build",
23 | "options": {
24 | "cwd": "${workspaceFolder}/database/Library"
25 | }
26 | },
27 | {
28 | "label": "3. Publish SQL Database project",
29 | "type": "shell",
30 | "command": "bash",
31 | "args": [
32 | ".devcontainer/sql/postCreateCommand.sh",
33 | "database/Library/bin/Debug"
34 | ]
35 | },
36 | {
37 | "label": "4. Update .NET SDK",
38 | "type": "shell",
39 | "command": "sudo dotnet workload update"
40 | },
41 | {
42 | "label": "5. Trust .NET HTTPS certificate",
43 | "type": "shell",
44 | "command": "dotnet dev-certs https --trust"
45 | }
46 | ]
47 | }
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/Library.sqlproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Library
6 | {478C0943-4ABE-4FFA-8797-721915EB2B70}
7 | Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider
8 | 1033, CI
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/Sequences/globalId.sql:
--------------------------------------------------------------------------------
1 | CREATE SEQUENCE [dbo].[globalId]
2 | AS INT
3 | START WITH 1000000
4 | INCREMENT BY 1;
5 |
6 |
7 | GO
8 |
9 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/StoredProcedures/stp_get_all_cowritten_books_by_author.sql:
--------------------------------------------------------------------------------
1 |
2 | create procedure dbo.stp_get_all_cowritten_books_by_author
3 | @author nvarchar(100),
4 | @searchType char(1) = 'c'
5 | as
6 |
7 | declare @authorSearchString nvarchar(110);
8 |
9 | if @searchType = 'c'
10 | set @authorSearchString = '%' + @author + '%' -- contains
11 | else if @searchType = 's'
12 | set @authorSearchString = @author + '%' -- startswith
13 | else
14 | throw 50000, '@searchType must be set to "c" or "s"', 16;
15 |
16 | with
17 | aggregated_authors
18 | as
19 | (
20 | select
21 | ba.book_id,
22 | string_agg(concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name), ', ') as authors,
23 | author_count = count(*)
24 | from
25 | dbo.books_authors ba
26 | inner join
27 | dbo.authors a on ba.author_id = a.id
28 | group by
29 | ba.book_id
30 | )
31 | select
32 | b.id,
33 | b.title,
34 | b.pages,
35 | b.[year],
36 | aa.authors
37 | from
38 | dbo.books b
39 | inner join
40 | aggregated_authors aa on b.id = aa.book_id
41 | inner join
42 | dbo.books_authors ba on b.id = ba.book_id
43 | inner join
44 | dbo.authors a on a.id = ba.author_id
45 | where
46 | aa.author_count > 1
47 | and
48 | (
49 | concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name) like @authorSearchString
50 | or
51 | concat(a.first_name, ' ', a.last_name) like @authorSearchString
52 | );
53 |
54 | GO
55 |
56 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/Tables/authors.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[authors] (
2 | [id] INT DEFAULT (NEXT VALUE FOR [dbo].[globalId]) NOT NULL,
3 | [first_name] NVARCHAR (100) NOT NULL,
4 | [middle_name] NVARCHAR (100) NULL,
5 | [last_name] NVARCHAR (100) NOT NULL,
6 | PRIMARY KEY CLUSTERED ([id] ASC)
7 | );
8 |
9 |
10 | GO
11 |
12 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/Tables/books.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[books] (
2 | [id] INT DEFAULT (NEXT VALUE FOR [dbo].[globalId]) NOT NULL,
3 | [title] NVARCHAR (1000) NOT NULL,
4 | [year] INT NULL,
5 | [pages] INT NULL,
6 | PRIMARY KEY CLUSTERED ([id] ASC)
7 | );
8 |
9 |
10 | GO
11 |
12 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/Tables/books_authors.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[books_authors] (
2 | [author_id] INT NOT NULL,
3 | [book_id] INT NOT NULL,
4 | PRIMARY KEY CLUSTERED ([author_id] ASC, [book_id] ASC),
5 | FOREIGN KEY ([author_id]) REFERENCES [dbo].[authors] ([id]),
6 | FOREIGN KEY ([book_id]) REFERENCES [dbo].[books] ([id])
7 | );
8 |
9 |
10 | GO
11 |
12 | CREATE NONCLUSTERED INDEX [ixnc1]
13 | ON [dbo].[books_authors]([book_id] ASC, [author_id] ASC);
14 |
15 |
16 | GO
17 |
18 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/Views/vw_books_details.sql:
--------------------------------------------------------------------------------
1 |
2 | create view dbo.vw_books_details
3 | as
4 | with
5 | aggregated_authors
6 | as
7 | (
8 | select
9 | ba.book_id,
10 | string_agg(concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name), ', ') as authors
11 | from
12 | dbo.books_authors ba
13 | inner join
14 | dbo.authors a on ba.author_id = a.id
15 | group by
16 | ba.book_id
17 | )
18 | select
19 | b.id,
20 | b.title,
21 | b.pages,
22 | b.[year],
23 | aa.authors
24 | from
25 | dbo.books b
26 | inner join
27 | aggregated_authors aa on b.id = aa.book_id
28 |
29 | GO
30 |
31 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/bin/Debug/Library.dacpac:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/database/Library/bin/Debug/Library.dacpac
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/bin/Debug/Library.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/database/Library/bin/Debug/Library.dll
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/bin/Debug/Library.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/database/Library/bin/Debug/Library.pdb
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/obj/Debug/Library.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/database/Library/obj/Debug/Library.dll
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/obj/Debug/Library.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/database/Library/obj/Debug/Library.pdb
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/obj/Debug/Library.sqlproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.dacpac
2 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.dll
3 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.pdb
4 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Model.xml
5 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/refactor.xml
6 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/postdeploy.sql
7 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/predeploy.sql
8 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Library.dll
9 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Library.pdb
10 | /workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/bin/Debug/Library.dacpac
11 | /workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/bin/Debug/Library.dll
12 | /workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/bin/Debug/Library.pdb
13 | /workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/obj/Debug/Model.xml
14 | /workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/obj/Debug/refactor.xml
15 | /workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/obj/Debug/postdeploy.sql
16 | /workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/obj/Debug/predeploy.sql
17 | /workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/obj/Debug/Library.dll
18 | /workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/obj/Debug/Library.pdb
19 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/obj/Library.sqlproj.nuget.dgspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "format": 1,
3 | "restore": {
4 | "/workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/Library.sqlproj": {}
5 | },
6 | "projects": {
7 | "/workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/Library.sqlproj": {
8 | "version": "1.0.0",
9 | "restore": {
10 | "projectUniqueName": "/workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/Library.sqlproj",
11 | "projectName": "Library",
12 | "projectPath": "/workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/Library.sqlproj",
13 | "packagesPath": "/home/codespace/.nuget/packages/",
14 | "outputPath": "/workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/obj/",
15 | "projectStyle": "PackageReference",
16 | "skipContentFileWrite": true,
17 | "configFilePaths": [
18 | "/home/codespace/.nuget/NuGet/NuGet.Config"
19 | ],
20 | "originalTargetFrameworks": [
21 | "net46"
22 | ],
23 | "sources": {
24 | "https://api.nuget.org/v3/index.json": {}
25 | },
26 | "frameworks": {
27 | "net46": {
28 | "projectReferences": {}
29 | }
30 | },
31 | "warningProperties": {
32 | "noWarn": [
33 | "NU5128"
34 | ]
35 | },
36 | "restoreAuditProperties": {
37 | "enableAudit": "true",
38 | "auditLevel": "low",
39 | "auditMode": "direct"
40 | }
41 | },
42 | "frameworks": {
43 | "net46": {
44 | "dependencies": {
45 | "Microsoft.NETFramework.ReferenceAssemblies": {
46 | "suppressParent": "All",
47 | "target": "Package",
48 | "version": "[1.0.0, )"
49 | }
50 | }
51 | }
52 | }
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/obj/Library.sqlproj.nuget.g.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | True
5 | NuGet
6 | $(MSBuildThisFileDirectory)project.assets.json
7 | /home/codespace/.nuget/packages/
8 | /home/codespace/.nuget/packages/
9 | PackageReference
10 | 6.10.0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/obj/Library.sqlproj.nuget.g.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/database/Library/obj/project.nuget.cache:
--------------------------------------------------------------------------------
1 | {
2 | "version": 2,
3 | "dgSpecHash": "jvzkYJdUYNs=",
4 | "success": true,
5 | "projectFilePath": "/workspaces/azuresql-devcontainers/src/dotnet-aspire/database/Library/Library.sqlproj",
6 | "expectedPackageFiles": [
7 | "/home/codespace/.nuget/packages/microsoft.netframework.referenceassemblies/1.0.0/microsoft.netframework.referenceassemblies.1.0.0.nupkg.sha512",
8 | "/home/codespace/.nuget/packages/microsoft.netframework.referenceassemblies.net46/1.0.0/microsoft.netframework.referenceassemblies.net46.1.0.0.nupkg.sha512"
9 | ],
10 | "logs": []
11 | }
--------------------------------------------------------------------------------
/src/dotnet-aspire/devcontainer-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "dotnet-aspire",
3 | "version": "1.2.2",
4 | "name": ".NET with Aspire and Azure SQL",
5 | "description": "A development environment for .NET Aspire and Azure SQL, enabling streamlined local development and testing.",
6 | "documentationURL": "https://github.com/microsoft/azuresql-devcontainers/tree/main/src/dotnet-aspire",
7 | "publisher": "Azure SQL Developer Experiences Team",
8 | "licenseURL": "https://github.com/devcontainers/templates/blob/main/LICENSE",
9 | "options": {
10 | "imageVariant": {
11 | "type": "string",
12 | "description": ".NET version:",
13 | "proposals": [
14 | "8.0-bookworm",
15 | "8.0-jammy"
16 | ],
17 | "default": "8.0-bookworm"
18 | }
19 | },
20 | "platforms": [
21 | ".NET",
22 | ".NET Core",
23 | ".NET Aspire",
24 | "Azure SQL Database"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-continue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-continue.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-dotnet-aspire.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-dotnet-aspire.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-dotnet-cert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-dotnet-cert.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-list-dotnet-aspire.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-list-dotnet-aspire.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-project-build.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-project-build.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-project-publish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-project-publish.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-sql-profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-sql-profile.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-sql-results.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-sql-results.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-sql-run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-task-sql-run.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-tasks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet-aspire/images/vscode-azure-sql-devcontainers-tasks.png
--------------------------------------------------------------------------------
/src/dotnet-aspire/scripts/verifyDatabase.sql:
--------------------------------------------------------------------------------
1 | -- Copyright (c) Microsoft Corporation.
2 | -- Licensed under the MIT License.
3 |
4 | -- Verifying database
5 | select * from library.dbo.authors;
6 | GO
7 | select * from library.dbo.books;
8 | GO
--------------------------------------------------------------------------------
/src/dotnet/.devcontainer/.env:
--------------------------------------------------------------------------------
1 | MSSQL_SA_PASSWORD=P@ssw0rd!
--------------------------------------------------------------------------------
/src/dotnet/.devcontainer/Dockerfile:
--------------------------------------------------------------------------------
1 | # [Choice] .NET version: 8.0-bookworm, 8.0-jammy, 8.0-bullseye
2 | FROM mcr.microsoft.com/devcontainers/dotnet:1-${templateOption:imageVariant}
3 |
4 | # Add .NET global tools path
5 | ENV PATH $PATH:/home/vscode/.dotnet:/home/vscode/.dotnet/tools
6 |
7 | # [Optional] Uncomment this section to install additional OS packages.
8 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9 | && apt-get -y install --no-install-recommends software-properties-common
10 |
11 | # Install SQL Tools: SQLPackage and sqlcmd
12 | COPY sql/installSQLtools.sh installSQLtools.sh
13 | RUN bash ./installSQLtools.sh \
14 | && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
--------------------------------------------------------------------------------
/src/dotnet/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // For format details, see https://aka.ms/devcontainer.json.
2 | // For config options, see the README at: https://github.com/microsoft/azuresql-devcontainers/tree/main/src/dotnet
3 | {
4 | "name": ".NET and Azure SQL",
5 | "dockerComposeFile": "docker-compose.yml",
6 | "service": "app",
7 | "workspaceFolder": "/workspace",
8 | "customizations": {
9 | // Configure properties specific to VS Code.
10 | "vscode": {
11 | // Set *default* container specific settings.json values on container create.
12 | "settings": {
13 | "mssql.connections": [
14 | {
15 | "server": "localhost,1433",
16 | "database": "master",
17 | "authenticationType": "SqlLogin",
18 | "user": "sa",
19 | "password": "${env:MSSQL_SA_PASSWORD}",
20 | "savePassword": true,
21 | "profileName": "LocalDev",
22 | "trustServerCertificate": true
23 | }
24 | ],
25 | "sqlDatabaseProjects.dotnetSDK Location": "/usr/share/dotnet"
26 | },
27 | // Add the IDs of extensions you want installed when the container is created.
28 | "extensions": [
29 | "ms-dotnettools.csdevkit",
30 | "ms-dotnettools.csharp",
31 | "ms-azuretools.vscode-bicep",
32 | "ms-mssql.mssql",
33 | "ms-azuretools.vscode-docker",
34 | "github.copilot",
35 | "github.codespaces"
36 | ]
37 | }
38 | },
39 |
40 | // Use 'forwardPorts' to make a list of ports inside the container available locally.
41 | "forwardPorts": [5000, 5001, 8000, 1433],
42 |
43 | // Post create commands to run after the container is created.
44 | "postCreateCommand": "bash .devcontainer/sql/postCreateCommand.sh 'database/Library/bin/Debug'",
45 |
46 | // Post start commands to run after the container is started.
47 |
48 | // Features to add to the dev container. More info: https://containers.dev/features.
49 | "features": {
50 | "ghcr.io/devcontainers/features/azure-cli:1": {
51 | "installBicep": true,
52 | "installUsingPython": true,
53 | "version": "latest"
54 | },
55 | "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
56 | "version": "latest"
57 | },
58 | "ghcr.io/azure/azure-dev/azd:latest": {
59 | "version": "latest"
60 | }
61 | }
62 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
63 | // "remoteUser": "root"
64 | }
--------------------------------------------------------------------------------
/src/dotnet/.devcontainer/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 | app:
5 | build:
6 | context: .
7 | dockerfile: Dockerfile
8 |
9 | volumes:
10 | - ..:/workspace:cached
11 |
12 | # Overrides default command so things don't shut down after the process ends.
13 | command: sleep infinity
14 |
15 | # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
16 | network_mode: service:db
17 | # Uncomment the next line to use a non-root user for all processes.
18 | # user: vscode
19 |
20 | # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
21 | # (Adding the "ports" property to this file will not forward from a Codespace.)
22 |
23 | db:
24 | image: mcr.microsoft.com/azure-sql-edge
25 | hostname: SQL-Library
26 | container_name: SQL-Library
27 | restart: unless-stopped
28 | environment:
29 | ACCEPT_EULA: Y
30 | env_file:
31 | - .env
32 | deploy:
33 | resources:
34 | limits:
35 | cpus: '1'
36 | memory: 2048M
37 | # Add "forwardPorts": ["1433"] to **devcontainer.json** to forward MSSQL locally.
38 | # (Adding the "ports" property to this file will not forward from a Codespace.)
--------------------------------------------------------------------------------
/src/dotnet/.devcontainer/sql/installSQLtools.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Installing Go-SQLCmd ..."
4 | curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
5 | sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/prod.list)"
6 | sudo apt-get update
7 | sudo apt-get install -y sqlcmd
8 | echo "Go-SQLCmd installed."
9 |
10 | echo "Installing Sqlpackage ..."
11 | curl -sSL -o sqlpackage.zip "https://aka.ms/sqlpackage-linux"
12 | mkdir -p /opt/sqlpackage
13 | unzip sqlpackage.zip -d /opt/sqlpackage && rm sqlpackage.zip
14 | chmod a+x /opt/sqlpackage/sqlpackage
15 | echo "Sqlpackage installed."
--------------------------------------------------------------------------------
/src/dotnet/.devcontainer/sql/postCreateCommand.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Setting variables
4 | dacpac="false"
5 |
6 | # Load SA_PASSWORD from .env file
7 | export $(grep -v '^#' .devcontainer/.env | xargs)
8 | SApassword=$MSSQL_SA_PASSWORD
9 |
10 | # Parameters
11 | dacpath=$1
12 |
13 | # Extract the project directory from the dacpath
14 | projectDir=$(echo $dacpath | cut -d'/' -f1-2)
15 |
16 | echo "SELECT * FROM SYS.DATABASES" | dd of=testsqlconnection.sql
17 | for i in {1..30};
18 | do
19 | sqlcmd -S localhost -U sa -P $SApassword -d master -i testsqlconnection.sql > /dev/null
20 | if [ $? -eq 0 ]
21 | then
22 | echo "SQL server ready"
23 | break
24 | else
25 | echo "Not ready yet..."
26 | sleep 1
27 | fi
28 | done
29 | rm testsqlconnection.sql
30 |
31 | for f in $dacpath/*
32 | do
33 | if [ $f == $dacpath/*".dacpac" ]
34 | then
35 | dacpac="true"
36 | echo "Found dacpac $f"
37 | fi
38 | done
39 |
40 | if [ $dacpac == "true" ]
41 | then
42 | # Build the SQL Database project
43 | echo "Building SQL Database project at $projectDir..."
44 | dotnet build $projectDir
45 |
46 | for f in $dacpath/*
47 | do
48 | if [ $f == $dacpath/*".dacpac" ]
49 | then
50 | dbname=$(basename $f ".dacpac")
51 | # Deploy the dacpac
52 | echo "Deploying dacpac $f"
53 | /opt/sqlpackage/sqlpackage /Action:Publish /SourceFile:$f /TargetServerName:localhost /TargetDatabaseName:$dbname /TargetUser:sa /TargetPassword:$SApassword /TargetTrustServerCertificate:True
54 | fi
55 | done
56 | fi
--------------------------------------------------------------------------------
/src/dotnet/.gitattributes:
--------------------------------------------------------------------------------
1 | # Git will always convert line endings to LF on checkout.
2 | # Used for files that must keep LF endings, even on Windows.
3 | *.sh text eol=lf
--------------------------------------------------------------------------------
/src/dotnet/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the tasks.json format
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "label": "1. Verify database schema and data",
8 | "type": "shell",
9 | "command": "code",
10 | "args": [
11 | "--goto",
12 | "${workspaceFolder}/scripts/verifyDatabase.sql"
13 | ],
14 | "presentation": {
15 | "reveal": "always",
16 | "panel": "new"
17 | }
18 | },
19 | {
20 | "label": "2. Build SQL Database project",
21 | "type": "shell",
22 | "command": "dotnet build",
23 | "options": {
24 | "cwd": "${workspaceFolder}/database/Library"
25 | }
26 | },
27 | {
28 | "label": "3. Publish SQL Database project",
29 | "type": "shell",
30 | "command": "bash",
31 | "args": [
32 | ".devcontainer/sql/postCreateCommand.sh",
33 | "database/Library/bin/Debug"
34 | ]
35 | },
36 | {
37 | "label": "4. Trust .NET HTTPS certificate",
38 | "type": "shell",
39 | "command": "dotnet dev-certs https --trust"
40 | }
41 | ]
42 | }
--------------------------------------------------------------------------------
/src/dotnet/database/Library/Library.sqlproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Library
6 | {478C0943-4ABE-4FFA-8797-721915EB2B70}
7 | Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider
8 | 1033, CI
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/dotnet/database/Library/Sequences/globalId.sql:
--------------------------------------------------------------------------------
1 | CREATE SEQUENCE [dbo].[globalId]
2 | AS INT
3 | START WITH 1000000
4 | INCREMENT BY 1;
5 |
6 |
7 | GO
8 |
9 |
--------------------------------------------------------------------------------
/src/dotnet/database/Library/StoredProcedures/stp_get_all_cowritten_books_by_author.sql:
--------------------------------------------------------------------------------
1 |
2 | create procedure dbo.stp_get_all_cowritten_books_by_author
3 | @author nvarchar(100),
4 | @searchType char(1) = 'c'
5 | as
6 |
7 | declare @authorSearchString nvarchar(110);
8 |
9 | if @searchType = 'c'
10 | set @authorSearchString = '%' + @author + '%' -- contains
11 | else if @searchType = 's'
12 | set @authorSearchString = @author + '%' -- startswith
13 | else
14 | throw 50000, '@searchType must be set to "c" or "s"', 16;
15 |
16 | with
17 | aggregated_authors
18 | as
19 | (
20 | select
21 | ba.book_id,
22 | string_agg(concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name), ', ') as authors,
23 | author_count = count(*)
24 | from
25 | dbo.books_authors ba
26 | inner join
27 | dbo.authors a on ba.author_id = a.id
28 | group by
29 | ba.book_id
30 | )
31 | select
32 | b.id,
33 | b.title,
34 | b.pages,
35 | b.[year],
36 | aa.authors
37 | from
38 | dbo.books b
39 | inner join
40 | aggregated_authors aa on b.id = aa.book_id
41 | inner join
42 | dbo.books_authors ba on b.id = ba.book_id
43 | inner join
44 | dbo.authors a on a.id = ba.author_id
45 | where
46 | aa.author_count > 1
47 | and
48 | (
49 | concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name) like @authorSearchString
50 | or
51 | concat(a.first_name, ' ', a.last_name) like @authorSearchString
52 | );
53 |
54 | GO
55 |
56 |
--------------------------------------------------------------------------------
/src/dotnet/database/Library/Tables/authors.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[authors] (
2 | [id] INT DEFAULT (NEXT VALUE FOR [dbo].[globalId]) NOT NULL,
3 | [first_name] NVARCHAR (100) NOT NULL,
4 | [middle_name] NVARCHAR (100) NULL,
5 | [last_name] NVARCHAR (100) NOT NULL,
6 | PRIMARY KEY CLUSTERED ([id] ASC)
7 | );
8 |
9 |
10 | GO
11 |
12 |
--------------------------------------------------------------------------------
/src/dotnet/database/Library/Tables/books.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[books] (
2 | [id] INT DEFAULT (NEXT VALUE FOR [dbo].[globalId]) NOT NULL,
3 | [title] NVARCHAR (1000) NOT NULL,
4 | [year] INT NULL,
5 | [pages] INT NULL,
6 | PRIMARY KEY CLUSTERED ([id] ASC)
7 | );
8 |
9 |
10 | GO
11 |
12 |
--------------------------------------------------------------------------------
/src/dotnet/database/Library/Tables/books_authors.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[books_authors] (
2 | [author_id] INT NOT NULL,
3 | [book_id] INT NOT NULL,
4 | PRIMARY KEY CLUSTERED ([author_id] ASC, [book_id] ASC),
5 | FOREIGN KEY ([author_id]) REFERENCES [dbo].[authors] ([id]),
6 | FOREIGN KEY ([book_id]) REFERENCES [dbo].[books] ([id])
7 | );
8 |
9 |
10 | GO
11 |
12 | CREATE NONCLUSTERED INDEX [ixnc1]
13 | ON [dbo].[books_authors]([book_id] ASC, [author_id] ASC);
14 |
15 |
16 | GO
17 |
18 |
--------------------------------------------------------------------------------
/src/dotnet/database/Library/Views/vw_books_details.sql:
--------------------------------------------------------------------------------
1 |
2 | create view dbo.vw_books_details
3 | as
4 | with
5 | aggregated_authors
6 | as
7 | (
8 | select
9 | ba.book_id,
10 | string_agg(concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name), ', ') as authors
11 | from
12 | dbo.books_authors ba
13 | inner join
14 | dbo.authors a on ba.author_id = a.id
15 | group by
16 | ba.book_id
17 | )
18 | select
19 | b.id,
20 | b.title,
21 | b.pages,
22 | b.[year],
23 | aa.authors
24 | from
25 | dbo.books b
26 | inner join
27 | aggregated_authors aa on b.id = aa.book_id
28 |
29 | GO
30 |
31 |
--------------------------------------------------------------------------------
/src/dotnet/database/Library/bin/Debug/Library.dacpac:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/database/Library/bin/Debug/Library.dacpac
--------------------------------------------------------------------------------
/src/dotnet/database/Library/bin/Debug/Library.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/database/Library/bin/Debug/Library.dll
--------------------------------------------------------------------------------
/src/dotnet/database/Library/bin/Debug/Library.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/database/Library/bin/Debug/Library.pdb
--------------------------------------------------------------------------------
/src/dotnet/database/Library/obj/Debug/Library.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/database/Library/obj/Debug/Library.dll
--------------------------------------------------------------------------------
/src/dotnet/database/Library/obj/Debug/Library.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/database/Library/obj/Debug/Library.pdb
--------------------------------------------------------------------------------
/src/dotnet/database/Library/obj/Debug/Library.sqlproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.dacpac
2 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.dll
3 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.pdb
4 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Model.xml
5 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/refactor.xml
6 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/postdeploy.sql
7 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/predeploy.sql
8 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Library.dll
9 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Library.pdb
10 |
--------------------------------------------------------------------------------
/src/dotnet/database/Library/obj/Library.sqlproj.nuget.dgspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "format": 1,
3 | "restore": {
4 | "/workspaces/azuresql-devcontainers/src/dotnet/database/Library/Library.sqlproj": {}
5 | },
6 | "projects": {
7 | "/workspaces/azuresql-devcontainers/src/dotnet/database/Library/Library.sqlproj": {
8 | "version": "1.0.0",
9 | "restore": {
10 | "projectUniqueName": "/workspaces/azuresql-devcontainers/src/dotnet/database/Library/Library.sqlproj",
11 | "projectName": "Library",
12 | "projectPath": "/workspaces/azuresql-devcontainers/src/dotnet/database/Library/Library.sqlproj",
13 | "packagesPath": "/home/codespace/.nuget/packages/",
14 | "outputPath": "/workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/",
15 | "projectStyle": "PackageReference",
16 | "skipContentFileWrite": true,
17 | "configFilePaths": [
18 | "/home/codespace/.nuget/NuGet/NuGet.Config"
19 | ],
20 | "originalTargetFrameworks": [
21 | "net46"
22 | ],
23 | "sources": {
24 | "https://api.nuget.org/v3/index.json": {}
25 | },
26 | "frameworks": {
27 | "net46": {
28 | "projectReferences": {}
29 | }
30 | },
31 | "warningProperties": {
32 | "noWarn": [
33 | "NU5128"
34 | ]
35 | },
36 | "restoreAuditProperties": {
37 | "enableAudit": "true",
38 | "auditLevel": "low",
39 | "auditMode": "direct"
40 | }
41 | },
42 | "frameworks": {
43 | "net46": {
44 | "dependencies": {
45 | "Microsoft.NETFramework.ReferenceAssemblies": {
46 | "suppressParent": "All",
47 | "target": "Package",
48 | "version": "[1.0.0, )"
49 | }
50 | }
51 | }
52 | }
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/src/dotnet/database/Library/obj/Library.sqlproj.nuget.g.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | True
5 | NuGet
6 | $(MSBuildThisFileDirectory)project.assets.json
7 | /home/codespace/.nuget/packages/
8 | /home/codespace/.nuget/packages/
9 | PackageReference
10 | 6.10.0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/dotnet/database/Library/obj/Library.sqlproj.nuget.g.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/dotnet/database/Library/obj/project.nuget.cache:
--------------------------------------------------------------------------------
1 | {
2 | "version": 2,
3 | "dgSpecHash": "GUDkKjZthvo=",
4 | "success": true,
5 | "projectFilePath": "/workspaces/azuresql-devcontainers/src/dotnet/database/Library/Library.sqlproj",
6 | "expectedPackageFiles": [
7 | "/home/codespace/.nuget/packages/microsoft.netframework.referenceassemblies/1.0.0/microsoft.netframework.referenceassemblies.1.0.0.nupkg.sha512",
8 | "/home/codespace/.nuget/packages/microsoft.netframework.referenceassemblies.net46/1.0.0/microsoft.netframework.referenceassemblies.net46.1.0.0.nupkg.sha512"
9 | ],
10 | "logs": []
11 | }
--------------------------------------------------------------------------------
/src/dotnet/database/Library/postDeployment.sql:
--------------------------------------------------------------------------------
1 | -- This file contains SQL statements that will be executed after the build script.
2 | -- Authors data
3 | ---------------------------------------------------------------------------
4 | IF NOT EXISTS (SELECT 1 FROM dbo.authors WHERE id = 1)
5 | BEGIN
6 | INSERT INTO dbo.authors (id, first_name, middle_name, last_name)
7 | VALUES (1, 'Isaac', 'Yudovick', 'Asimov')
8 | END;
9 |
10 | IF NOT EXISTS (SELECT 1 FROM dbo.authors WHERE id = 2)
11 | BEGIN
12 | INSERT INTO dbo.authors (id, first_name, middle_name, last_name)
13 | VALUES (2, 'Arthur', 'Charles', 'Clarke')
14 | END;
15 |
16 | IF NOT EXISTS (SELECT 1 FROM dbo.authors WHERE id = 3)
17 | BEGIN
18 | INSERT INTO dbo.authors (id, first_name, middle_name, last_name)
19 | VALUES (3, 'Herbert', 'George', 'Wells')
20 | END;
21 |
22 | IF NOT EXISTS (SELECT 1 FROM dbo.authors WHERE id = 4)
23 | BEGIN
24 | INSERT INTO dbo.authors (id, first_name, middle_name, last_name)
25 | VALUES (4, 'Jules', 'Gabriel', 'Verne')
26 | END;
27 |
28 | IF NOT EXISTS (SELECT 1 FROM dbo.authors WHERE id = 5)
29 | BEGIN
30 | INSERT INTO dbo.authors (id, first_name, middle_name, last_name)
31 | VALUES (5, 'Philip', 'Kindred', 'Dick')
32 | END;
33 | GO
34 |
35 | -- Books data
36 | ---------------------------------------------------------------------------
37 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1000)
38 | BEGIN
39 | INSERT INTO dbo.books (id, title, year, pages)
40 | VALUES (1000, 'Prelude to Foundation', 1988, 403)
41 | END;
42 |
43 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1001)
44 | BEGIN
45 | INSERT INTO dbo.books (id, title, year, pages)
46 | VALUES (1001, 'Forward the Foundation', 1993, 417)
47 | END;
48 |
49 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1002)
50 | BEGIN
51 | INSERT INTO dbo.books (id, title, year, pages)
52 | VALUES (1002, 'Foundation', 1951, 255)
53 | END;
54 |
55 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1003)
56 | BEGIN
57 | INSERT INTO dbo.books (id, title, year, pages)
58 | VALUES (1003, 'Foundation and Empire', 1952, 247)
59 | END;
60 |
61 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1004)
62 | BEGIN
63 | INSERT INTO dbo.books (id, title, year, pages)
64 | VALUES (1004, 'Second Foundation', 1953, 210)
65 | END;
66 |
67 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1005)
68 | BEGIN
69 | INSERT INTO dbo.books (id, title, year, pages)
70 | VALUES (1005, 'Foundation''s Edge', 1982, 367)
71 | END;
72 |
73 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1006)
74 | BEGIN
75 | INSERT INTO dbo.books (id, title, year, pages)
76 | VALUES (1006, 'Foundation and Earth', 1986, 356)
77 | END;
78 |
79 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1007)
80 | BEGIN
81 | INSERT INTO dbo.books (id, title, year, pages)
82 | VALUES (1007, 'Nemesis', 1989, 386)
83 | END;
84 |
85 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1008)
86 | BEGIN
87 | INSERT INTO dbo.books (id, title, year, pages)
88 | VALUES (1008, '2001: A Space Odyssey', 1968, 221)
89 | END;
90 |
91 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1009)
92 | BEGIN
93 | INSERT INTO dbo.books (id, title, year, pages)
94 | VALUES (1009, '2010: Odyssey Two', 1982, 291)
95 | END;
96 |
97 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1010)
98 | BEGIN
99 | INSERT INTO dbo.books (id, title, year, pages)
100 | VALUES (1010, '2061: Odyssey Three ', 1987, 256)
101 | END;
102 |
103 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1011)
104 | BEGIN
105 | INSERT INTO dbo.books (id, title, year, pages)
106 | VALUES (1011, '3001: The Final Odyssey ', 1997, 288)
107 | END;
108 |
109 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1012)
110 | BEGIN
111 | INSERT INTO dbo.books (id, title, year, pages)
112 | VALUES (1012, 'The Time Machine', 1895, 118)
113 | END;
114 |
115 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1013)
116 | BEGIN
117 | INSERT INTO dbo.books (id, title, year, pages)
118 | VALUES (1013, 'The Island of Doctor Moreau', 1896, 153)
119 | END;
120 |
121 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1014)
122 | BEGIN
123 | INSERT INTO dbo.books (id, title, year, pages)
124 | VALUES (1014, 'The Invisible Man', 1897, 151)
125 | END;
126 |
127 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1015)
128 | BEGIN
129 | INSERT INTO dbo.books (id, title, year, pages)
130 | VALUES (1015, 'The War of the Worlds', 1898, 192)
131 | END;
132 |
133 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1016)
134 | BEGIN
135 | INSERT INTO dbo.books (id, title, year, pages)
136 | VALUES (1016, 'Journey to the Center of the Earth', 1864, 183)
137 | END;
138 |
139 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1017)
140 | BEGIN
141 | INSERT INTO dbo.books (id, title, year, pages)
142 | VALUES (1017, 'Twenty Thousand Leagues Under the Sea', 1870, 187)
143 | END;
144 |
145 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1018)
146 | BEGIN
147 | INSERT INTO dbo.books (id, title, year, pages)
148 | VALUES (1018, 'Around the World in Eighty Days', 1873, 167)
149 | END;
150 |
151 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1019)
152 | BEGIN
153 | INSERT INTO dbo.books (id, title, year, pages)
154 | VALUES (1019, 'From the Earth to the Moon', 1865, 186)
155 | END;
156 |
157 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1020)
158 | BEGIN
159 | INSERT INTO dbo.books (id, title, year, pages)
160 | VALUES (1020, 'Do Androids Dream of Electric Sheep?', 1968, 244)
161 | END;
162 |
163 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1021)
164 | BEGIN
165 | INSERT INTO dbo.books (id, title, year, pages)
166 | VALUES (1021, 'Ubik', 1969, 224)
167 | END;
168 |
169 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1022)
170 | BEGIN
171 | INSERT INTO dbo.books (id, title, year, pages)
172 | VALUES (1022, 'The Man in the High Castle', 1962, 259)
173 | END;
174 |
175 | IF NOT EXISTS (SELECT 1 FROM dbo.books WHERE id = 1023)
176 | BEGIN
177 | INSERT INTO dbo.books (id, title, year, pages)
178 | VALUES (1023, 'A Scanner Darkly', 1977, 224)
179 | END;
180 | GO
181 |
182 | -- Books + Authors data
183 | ---------------------------------------------------------------------------
184 | -- Insert records for author 1
185 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 1 AND book_id = 1000)
186 | BEGIN
187 | INSERT INTO dbo.books_authors (author_id, book_id)
188 | VALUES (1, 1000)
189 | END;
190 |
191 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 1 AND book_id = 1001)
192 | BEGIN
193 | INSERT INTO dbo.books_authors (author_id, book_id)
194 | VALUES (1, 1001)
195 | END;
196 |
197 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 1 AND book_id = 1002)
198 | BEGIN
199 | INSERT INTO dbo.books_authors (author_id, book_id)
200 | VALUES (1, 1002)
201 | END;
202 |
203 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 1 AND book_id = 1003)
204 | BEGIN
205 | INSERT INTO dbo.books_authors (author_id, book_id)
206 | VALUES (1, 1003)
207 | END;
208 |
209 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 1 AND book_id = 1004)
210 | BEGIN
211 | INSERT INTO dbo.books_authors (author_id, book_id)
212 | VALUES (1, 1004)
213 | END;
214 |
215 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 1 AND book_id = 1005)
216 | BEGIN
217 | INSERT INTO dbo.books_authors (author_id, book_id)
218 | VALUES (1, 1005)
219 | END;
220 |
221 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 1 AND book_id = 1006)
222 | BEGIN
223 | INSERT INTO dbo.books_authors (author_id, book_id)
224 | VALUES (1, 1006)
225 | END;
226 |
227 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 1 AND book_id = 1007)
228 | BEGIN
229 | INSERT INTO dbo.books_authors (author_id, book_id)
230 | VALUES (1, 1007)
231 | END;
232 |
233 | -- Insert records for author 2
234 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 2 AND book_id = 1008)
235 | BEGIN
236 | INSERT INTO dbo.books_authors (author_id, book_id)
237 | VALUES (2, 1008)
238 | END;
239 |
240 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 2 AND book_id = 1009)
241 | BEGIN
242 | INSERT INTO dbo.books_authors (author_id, book_id)
243 | VALUES (2, 1009)
244 | END;
245 |
246 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 2 AND book_id = 1010)
247 | BEGIN
248 | INSERT INTO dbo.books_authors (author_id, book_id)
249 | VALUES (2, 1010)
250 | END;
251 |
252 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 2 AND book_id = 1011)
253 | BEGIN
254 | INSERT INTO dbo.books_authors (author_id, book_id)
255 | VALUES (2, 1011)
256 | END;
257 |
258 | -- Insert records for author 3
259 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 3 AND book_id = 1012)
260 | BEGIN
261 | INSERT INTO dbo.books_authors (author_id, book_id)
262 | VALUES (3, 1012)
263 | END;
264 |
265 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 3 AND book_id = 1013)
266 | BEGIN
267 | INSERT INTO dbo.books_authors (author_id, book_id)
268 | VALUES (3, 1013)
269 | END;
270 |
271 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 3 AND book_id = 1014)
272 | BEGIN
273 | INSERT INTO dbo.books_authors (author_id, book_id)
274 | VALUES (3, 1014)
275 | END;
276 |
277 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 3 AND book_id = 1015)
278 | BEGIN
279 | INSERT INTO dbo.books_authors (author_id, book_id)
280 | VALUES (3, 1015)
281 | END;
282 |
283 | -- Insert records for author 4
284 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 4 AND book_id = 1016)
285 | BEGIN
286 | INSERT INTO dbo.books_authors (author_id, book_id)
287 | VALUES (4, 1016)
288 | END;
289 |
290 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 4 AND book_id = 1017)
291 | BEGIN
292 | INSERT INTO dbo.books_authors (author_id, book_id)
293 | VALUES (4, 1017)
294 | END;
295 |
296 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 4 AND book_id = 1018)
297 | BEGIN
298 | INSERT INTO dbo.books_authors (author_id, book_id)
299 | VALUES (4, 1018)
300 | END;
301 |
302 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 4 AND book_id = 1019)
303 | BEGIN
304 | INSERT INTO dbo.books_authors (author_id, book_id)
305 | VALUES (4, 1019)
306 | END;
307 |
308 | -- Insert records for author 5
309 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 5 AND book_id = 1020)
310 | BEGIN
311 | INSERT INTO dbo.books_authors (author_id, book_id)
312 | VALUES (5, 1020)
313 | END;
314 |
315 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 5 AND book_id = 1021)
316 | BEGIN
317 | INSERT INTO dbo.books_authors (author_id, book_id)
318 | VALUES (5, 1021)
319 | END;
320 |
321 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 5 AND book_id = 1022)
322 | BEGIN
323 | INSERT INTO dbo.books_authors (author_id, book_id)
324 | VALUES (5, 1022)
325 | END;
326 |
327 | IF NOT EXISTS (SELECT 1 FROM dbo.books_authors WHERE author_id = 5 AND book_id = 1023)
328 | BEGIN
329 | INSERT INTO dbo.books_authors (author_id, book_id)
330 | VALUES (5, 1023)
331 | END;
332 | GO
--------------------------------------------------------------------------------
/src/dotnet/devcontainer-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "dotnet",
3 | "version": "1.2.2",
4 | "name": ".NET and Azure SQL",
5 | "description": "A development environment for .NET and Azure SQL, enabling streamlined local development and testing.",
6 | "documentationURL": "https://github.com/microsoft/azuresql-devcontainers/tree/main/src/dotnet",
7 | "publisher": "Azure SQL Developer Experiences Team",
8 | "licenseURL": "https://github.com/devcontainers/templates/blob/main/LICENSE",
9 | "options": {
10 | "imageVariant": {
11 | "type": "string",
12 | "description": ".NET version:",
13 | "proposals": [
14 | "8.0-bookworm",
15 | "8.0-jammy"
16 | ],
17 | "default": "8.0-bookworm"
18 | }
19 | },
20 | "platforms": [
21 | ".NET",
22 | ".NET Core",
23 | "Azure SQL Database"
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/src/dotnet/images/vscode-azure-sql-devcontainers-task-continue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/images/vscode-azure-sql-devcontainers-task-continue.png
--------------------------------------------------------------------------------
/src/dotnet/images/vscode-azure-sql-devcontainers-task-dotnet-cert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/images/vscode-azure-sql-devcontainers-task-dotnet-cert.png
--------------------------------------------------------------------------------
/src/dotnet/images/vscode-azure-sql-devcontainers-task-list-dotnet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/images/vscode-azure-sql-devcontainers-task-list-dotnet.png
--------------------------------------------------------------------------------
/src/dotnet/images/vscode-azure-sql-devcontainers-task-project-build.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/images/vscode-azure-sql-devcontainers-task-project-build.png
--------------------------------------------------------------------------------
/src/dotnet/images/vscode-azure-sql-devcontainers-task-project-publish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/images/vscode-azure-sql-devcontainers-task-project-publish.png
--------------------------------------------------------------------------------
/src/dotnet/images/vscode-azure-sql-devcontainers-task-sql-profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/images/vscode-azure-sql-devcontainers-task-sql-profile.png
--------------------------------------------------------------------------------
/src/dotnet/images/vscode-azure-sql-devcontainers-task-sql-results.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/images/vscode-azure-sql-devcontainers-task-sql-results.png
--------------------------------------------------------------------------------
/src/dotnet/images/vscode-azure-sql-devcontainers-task-sql-run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/images/vscode-azure-sql-devcontainers-task-sql-run.png
--------------------------------------------------------------------------------
/src/dotnet/images/vscode-azure-sql-devcontainers-tasks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/dotnet/images/vscode-azure-sql-devcontainers-tasks.png
--------------------------------------------------------------------------------
/src/dotnet/scripts/verifyDatabase.sql:
--------------------------------------------------------------------------------
1 | -- Verifying database
2 | select * from library.dbo.authors;
3 | GO
4 | select * from library.dbo.books;
5 | GO
--------------------------------------------------------------------------------
/src/javascript-node/.devcontainer/.env:
--------------------------------------------------------------------------------
1 | MSSQL_SA_PASSWORD=P@ssw0rd!
--------------------------------------------------------------------------------
/src/javascript-node/.devcontainer/Dockerfile:
--------------------------------------------------------------------------------
1 | # [Choice] Node.js version: 22-bookworm, 22-bullseye, 20-bookworm, 20-bullseye, 18-bookworm, 18-bullseye
2 | FROM mcr.microsoft.com/devcontainers/javascript-node:1-${templateOption:imageVariant}
3 |
4 | # [Optional] Uncomment this section to install additional OS packages.
5 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
6 | && apt-get -y install --no-install-recommends software-properties-common
7 |
8 | # Install SQL Tools: SQLPackage, sqlcmd and drivers
9 | COPY sql/installSQLtools.sh installSQLtools.sh
10 | RUN bash ./installSQLtools.sh \
11 | && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
12 |
13 | # Install .NET SDK 8 (for SQL Database projects)
14 | COPY dotnet/install-dotnet.sh install-dotnet.sh
15 | RUN bash ./install-dotnet.sh \
16 | && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
--------------------------------------------------------------------------------
/src/javascript-node/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // For format details, see https://aka.ms/devcontainer.json.
2 | // For config options, see the README at: https://github.com/microsoft/azuresql-devcontainers/tree/main/src/javascript-node
3 | {
4 | "name": "Node.js and Azure SQL",
5 | "dockerComposeFile": "docker-compose.yml",
6 | "service": "app",
7 | "workspaceFolder": "/workspace",
8 | "customizations": {
9 | // Configure properties specific to VS Code.
10 | "vscode": {
11 | // Set *default* container specific settings.json values on container create.
12 | "settings": {
13 | "mssql.connections": [
14 | {
15 | "server": "localhost,1433",
16 | "database": "master",
17 | "authenticationType": "SqlLogin",
18 | "user": "sa",
19 | "password": "${env:MSSQL_SA_PASSWORD}",
20 | "savePassword": true,
21 | "profileName": "LocalDev",
22 | "trustServerCertificate": true
23 | }
24 | ],
25 | "sqlDatabaseProjects.dotnetSDK Location": "/usr/share/dotnet"
26 | },
27 | // Add the IDs of extensions you want installed when the container is created.
28 | "extensions": [
29 | "dbaeumer.vscode-eslint",
30 | "eg2.vscode-npm-script",
31 | "christian-kohler.npm-intellisense",
32 | "esbenp.prettier-vscode",
33 | "ms-vscode.vscode-typescript-next",
34 | "ms-vscode.vscode-node-azure-pack",
35 | "ms-azuretools.vscode-docker",
36 | "ms-mssql.mssql",
37 | "github.copilot",
38 | "github.codespaces"
39 | ]
40 | }
41 | },
42 |
43 | // Use 'forwardPorts' to make a list of ports inside the container available locally.
44 | "forwardPorts": [3000, 1433],
45 |
46 | // Post create commands to run after the container is created.
47 | "postCreateCommand": "bash .devcontainer/sql/postCreateCommand.sh 'database/Library/bin/Debug'",
48 |
49 | // Post start commands to run after the container is started.
50 |
51 | // Features to add to the dev container. More info: https://containers.dev/features.
52 | "features": {
53 | "ghcr.io/devcontainers/features/azure-cli:1": {
54 | "installBicep": true,
55 | "installUsingPython": true,
56 | "version": "latest"
57 | },
58 | "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
59 | "version": "latest"
60 | },
61 | "ghcr.io/azure/azure-dev/azd:latest": {
62 | "version": "latest"
63 | }
64 | }
65 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
66 | // "remoteUser": "root"
67 | }
--------------------------------------------------------------------------------
/src/javascript-node/.devcontainer/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 | app:
5 | build:
6 | context: .
7 | dockerfile: Dockerfile
8 |
9 | volumes:
10 | - ..:/workspace:cached
11 |
12 | # Overrides default command so things don't shut down after the process ends.
13 | command: sleep infinity
14 |
15 | # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
16 | network_mode: service:db
17 | # Uncomment the next line to use a non-root user for all processes.
18 | # user: vscode
19 |
20 | # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
21 | # (Adding the "ports" property to this file will not forward from a Codespace.)
22 |
23 | db:
24 | image: mcr.microsoft.com/azure-sql-edge
25 | hostname: SQL-Library
26 | container_name: SQL-Library
27 | restart: unless-stopped
28 | environment:
29 | ACCEPT_EULA: Y
30 | env_file:
31 | - .env
32 | deploy:
33 | resources:
34 | limits:
35 | cpus: '1'
36 | memory: 2048M
37 | # Add "forwardPorts": ["1433"] to **devcontainer.json** to forward MSSQL locally.
38 | # (Adding the "ports" property to this file will not forward from a Codespace.)
--------------------------------------------------------------------------------
/src/javascript-node/.devcontainer/dotnet/install-dotnet.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Installing .NET 8 (SDK) ..."
4 | wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
5 | sudo dpkg -i packages-microsoft-prod.deb
6 | rm packages-microsoft-prod.deb
7 |
8 | sudo apt-get update && \
9 | sudo apt-get install -y dotnet-sdk-8.0
--------------------------------------------------------------------------------
/src/javascript-node/.devcontainer/sql/installSQLtools.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Installing Go-SQLCmd ..."
4 | curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
5 | sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/prod.list)"
6 | sudo apt-get update
7 | sudo apt-get install -y sqlcmd
8 | echo "Go-SQLCmd installed."
9 |
10 | echo "Installing Sqlpackage ..."
11 | curl -sSL -o sqlpackage.zip "https://aka.ms/sqlpackage-linux"
12 | mkdir -p /opt/sqlpackage
13 | unzip sqlpackage.zip -d /opt/sqlpackage && rm sqlpackage.zip
14 | chmod a+x /opt/sqlpackage/sqlpackage
15 | echo "Sqlpackage installed."
16 |
17 | echo "Installing mssql package for SQL Server connectivity in Node.js applications..."
18 | npm install -g mssql
19 | echo "mssql Node.js package installed."
--------------------------------------------------------------------------------
/src/javascript-node/.devcontainer/sql/postCreateCommand.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Setting variables
4 | dacpac="false"
5 |
6 | # Load SA_PASSWORD from .env file
7 | export $(grep -v '^#' .devcontainer/.env | xargs)
8 | SApassword=$MSSQL_SA_PASSWORD
9 |
10 | # Parameters
11 | dacpath=$1
12 |
13 | # Extract the project directory from the dacpath
14 | projectDir=$(echo $dacpath | cut -d'/' -f1-2)
15 |
16 | echo "SELECT * FROM SYS.DATABASES" | dd of=testsqlconnection.sql
17 | for i in {1..30};
18 | do
19 | sqlcmd -S localhost -U sa -P $SApassword -d master -i testsqlconnection.sql > /dev/null
20 | if [ $? -eq 0 ]
21 | then
22 | echo "SQL server ready"
23 | break
24 | else
25 | echo "Not ready yet..."
26 | sleep 1
27 | fi
28 | done
29 | rm testsqlconnection.sql
30 |
31 | for f in $dacpath/*
32 | do
33 | if [ $f == $dacpath/*".dacpac" ]
34 | then
35 | dacpac="true"
36 | echo "Found dacpac $f"
37 | fi
38 | done
39 |
40 | if [ $dacpac == "true" ]
41 | then
42 | # Build the SQL Database project
43 | echo "Building SQL Database project at $projectDir..."
44 | dotnet build $projectDir
45 |
46 | for f in $dacpath/*
47 | do
48 | if [ $f == $dacpath/*".dacpac" ]
49 | then
50 | dbname=$(basename $f ".dacpac")
51 | # Deploy the dacpac
52 | echo "Deploying dacpac $f"
53 | /opt/sqlpackage/sqlpackage /Action:Publish /SourceFile:$f /TargetServerName:localhost /TargetDatabaseName:$dbname /TargetUser:sa /TargetPassword:$SApassword /TargetTrustServerCertificate:True
54 | fi
55 | done
56 | fi
--------------------------------------------------------------------------------
/src/javascript-node/.gitattributes:
--------------------------------------------------------------------------------
1 | # Git will always convert line endings to LF on checkout.
2 | # Used for files that must keep LF endings, even on Windows.
3 | *.sh text eol=lf
--------------------------------------------------------------------------------
/src/javascript-node/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the tasks.json format
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "label": "1. Verify database schema and data",
8 | "type": "shell",
9 | "command": "code",
10 | "args": [
11 | "--goto",
12 | "${workspaceFolder}/scripts/verifyDatabase.sql"
13 | ],
14 | "presentation": {
15 | "reveal": "always",
16 | "panel": "new"
17 | }
18 | },
19 | {
20 | "label": "2. Build SQL Database project",
21 | "type": "shell",
22 | "command": "dotnet build",
23 | "options": {
24 | "cwd": "${workspaceFolder}/database/Library"
25 | }
26 | },
27 | {
28 | "label": "3. Publish SQL Database project",
29 | "type": "shell",
30 | "command": "bash",
31 | "args": [
32 | ".devcontainer/sql/postCreateCommand.sh",
33 | "database/Library/bin/Debug"
34 | ]
35 | }
36 | ]
37 | }
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/Library.sqlproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Library
6 | {478C0943-4ABE-4FFA-8797-721915EB2B70}
7 | Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider
8 | 1033, CI
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/Sequences/globalId.sql:
--------------------------------------------------------------------------------
1 | CREATE SEQUENCE [dbo].[globalId]
2 | AS INT
3 | START WITH 1000000
4 | INCREMENT BY 1;
5 |
6 |
7 | GO
8 |
9 |
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/StoredProcedures/stp_get_all_cowritten_books_by_author.sql:
--------------------------------------------------------------------------------
1 |
2 | create procedure dbo.stp_get_all_cowritten_books_by_author
3 | @author nvarchar(100),
4 | @searchType char(1) = 'c'
5 | as
6 |
7 | declare @authorSearchString nvarchar(110);
8 |
9 | if @searchType = 'c'
10 | set @authorSearchString = '%' + @author + '%' -- contains
11 | else if @searchType = 's'
12 | set @authorSearchString = @author + '%' -- startswith
13 | else
14 | throw 50000, '@searchType must be set to "c" or "s"', 16;
15 |
16 | with
17 | aggregated_authors
18 | as
19 | (
20 | select
21 | ba.book_id,
22 | string_agg(concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name), ', ') as authors,
23 | author_count = count(*)
24 | from
25 | dbo.books_authors ba
26 | inner join
27 | dbo.authors a on ba.author_id = a.id
28 | group by
29 | ba.book_id
30 | )
31 | select
32 | b.id,
33 | b.title,
34 | b.pages,
35 | b.[year],
36 | aa.authors
37 | from
38 | dbo.books b
39 | inner join
40 | aggregated_authors aa on b.id = aa.book_id
41 | inner join
42 | dbo.books_authors ba on b.id = ba.book_id
43 | inner join
44 | dbo.authors a on a.id = ba.author_id
45 | where
46 | aa.author_count > 1
47 | and
48 | (
49 | concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name) like @authorSearchString
50 | or
51 | concat(a.first_name, ' ', a.last_name) like @authorSearchString
52 | );
53 |
54 | GO
55 |
56 |
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/Tables/authors.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[authors] (
2 | [id] INT DEFAULT (NEXT VALUE FOR [dbo].[globalId]) NOT NULL,
3 | [first_name] NVARCHAR (100) NOT NULL,
4 | [middle_name] NVARCHAR (100) NULL,
5 | [last_name] NVARCHAR (100) NOT NULL,
6 | PRIMARY KEY CLUSTERED ([id] ASC)
7 | );
8 |
9 |
10 | GO
11 |
12 |
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/Tables/books.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[books] (
2 | [id] INT DEFAULT (NEXT VALUE FOR [dbo].[globalId]) NOT NULL,
3 | [title] NVARCHAR (1000) NOT NULL,
4 | [year] INT NULL,
5 | [pages] INT NULL,
6 | PRIMARY KEY CLUSTERED ([id] ASC)
7 | );
8 |
9 |
10 | GO
11 |
12 |
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/Tables/books_authors.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[books_authors] (
2 | [author_id] INT NOT NULL,
3 | [book_id] INT NOT NULL,
4 | PRIMARY KEY CLUSTERED ([author_id] ASC, [book_id] ASC),
5 | FOREIGN KEY ([author_id]) REFERENCES [dbo].[authors] ([id]),
6 | FOREIGN KEY ([book_id]) REFERENCES [dbo].[books] ([id])
7 | );
8 |
9 |
10 | GO
11 |
12 | CREATE NONCLUSTERED INDEX [ixnc1]
13 | ON [dbo].[books_authors]([book_id] ASC, [author_id] ASC);
14 |
15 |
16 | GO
17 |
18 |
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/Views/vw_books_details.sql:
--------------------------------------------------------------------------------
1 |
2 | create view dbo.vw_books_details
3 | as
4 | with
5 | aggregated_authors
6 | as
7 | (
8 | select
9 | ba.book_id,
10 | string_agg(concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name), ', ') as authors
11 | from
12 | dbo.books_authors ba
13 | inner join
14 | dbo.authors a on ba.author_id = a.id
15 | group by
16 | ba.book_id
17 | )
18 | select
19 | b.id,
20 | b.title,
21 | b.pages,
22 | b.[year],
23 | aa.authors
24 | from
25 | dbo.books b
26 | inner join
27 | aggregated_authors aa on b.id = aa.book_id
28 |
29 | GO
30 |
31 |
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/bin/Debug/Library.dacpac:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/database/Library/bin/Debug/Library.dacpac
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/bin/Debug/Library.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/database/Library/bin/Debug/Library.dll
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/bin/Debug/Library.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/database/Library/bin/Debug/Library.pdb
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/obj/Debug/Library.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/database/Library/obj/Debug/Library.dll
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/obj/Debug/Library.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/database/Library/obj/Debug/Library.pdb
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/obj/Debug/Library.sqlproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.dacpac
2 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.dll
3 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.pdb
4 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Model.xml
5 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/refactor.xml
6 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/postdeploy.sql
7 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/predeploy.sql
8 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Library.dll
9 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Library.pdb
10 | /workspaces/azuresql-devcontainers/src/javascript-node/database/Library/bin/Debug/Library.dacpac
11 | /workspaces/azuresql-devcontainers/src/javascript-node/database/Library/bin/Debug/Library.dll
12 | /workspaces/azuresql-devcontainers/src/javascript-node/database/Library/bin/Debug/Library.pdb
13 | /workspaces/azuresql-devcontainers/src/javascript-node/database/Library/obj/Debug/Model.xml
14 | /workspaces/azuresql-devcontainers/src/javascript-node/database/Library/obj/Debug/refactor.xml
15 | /workspaces/azuresql-devcontainers/src/javascript-node/database/Library/obj/Debug/postdeploy.sql
16 | /workspaces/azuresql-devcontainers/src/javascript-node/database/Library/obj/Debug/predeploy.sql
17 | /workspaces/azuresql-devcontainers/src/javascript-node/database/Library/obj/Debug/Library.dll
18 | /workspaces/azuresql-devcontainers/src/javascript-node/database/Library/obj/Debug/Library.pdb
19 |
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/obj/Library.sqlproj.nuget.dgspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "format": 1,
3 | "restore": {
4 | "/workspaces/azuresql-devcontainers/src/javascript-node/database/Library/Library.sqlproj": {}
5 | },
6 | "projects": {
7 | "/workspaces/azuresql-devcontainers/src/javascript-node/database/Library/Library.sqlproj": {
8 | "version": "1.0.0",
9 | "restore": {
10 | "projectUniqueName": "/workspaces/azuresql-devcontainers/src/javascript-node/database/Library/Library.sqlproj",
11 | "projectName": "Library",
12 | "projectPath": "/workspaces/azuresql-devcontainers/src/javascript-node/database/Library/Library.sqlproj",
13 | "packagesPath": "/home/codespace/.nuget/packages/",
14 | "outputPath": "/workspaces/azuresql-devcontainers/src/javascript-node/database/Library/obj/",
15 | "projectStyle": "PackageReference",
16 | "skipContentFileWrite": true,
17 | "configFilePaths": [
18 | "/home/codespace/.nuget/NuGet/NuGet.Config"
19 | ],
20 | "originalTargetFrameworks": [
21 | "net46"
22 | ],
23 | "sources": {
24 | "https://api.nuget.org/v3/index.json": {}
25 | },
26 | "frameworks": {
27 | "net46": {
28 | "projectReferences": {}
29 | }
30 | },
31 | "warningProperties": {
32 | "noWarn": [
33 | "NU5128"
34 | ]
35 | },
36 | "restoreAuditProperties": {
37 | "enableAudit": "true",
38 | "auditLevel": "low",
39 | "auditMode": "direct"
40 | }
41 | },
42 | "frameworks": {
43 | "net46": {
44 | "dependencies": {
45 | "Microsoft.NETFramework.ReferenceAssemblies": {
46 | "suppressParent": "All",
47 | "target": "Package",
48 | "version": "[1.0.0, )"
49 | }
50 | }
51 | }
52 | }
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/obj/Library.sqlproj.nuget.g.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | True
5 | NuGet
6 | $(MSBuildThisFileDirectory)project.assets.json
7 | /home/codespace/.nuget/packages/
8 | /home/codespace/.nuget/packages/
9 | PackageReference
10 | 6.10.0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/obj/Library.sqlproj.nuget.g.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/javascript-node/database/Library/obj/project.nuget.cache:
--------------------------------------------------------------------------------
1 | {
2 | "version": 2,
3 | "dgSpecHash": "X6ff9w+GEkE=",
4 | "success": true,
5 | "projectFilePath": "/workspaces/azuresql-devcontainers/src/javascript-node/database/Library/Library.sqlproj",
6 | "expectedPackageFiles": [
7 | "/home/codespace/.nuget/packages/microsoft.netframework.referenceassemblies/1.0.0/microsoft.netframework.referenceassemblies.1.0.0.nupkg.sha512",
8 | "/home/codespace/.nuget/packages/microsoft.netframework.referenceassemblies.net46/1.0.0/microsoft.netframework.referenceassemblies.net46.1.0.0.nupkg.sha512"
9 | ],
10 | "logs": []
11 | }
--------------------------------------------------------------------------------
/src/javascript-node/devcontainer-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "javascript-node",
3 | "version": "1.2.2",
4 | "name": "Node.js and Azure SQL",
5 | "description": "A development environment for Node.js and Azure SQL, enabling streamlined local development and testing.",
6 | "documentationURL": "https://github.com/microsoft/azuresql-devcontainers/tree/main/src/javascript-node",
7 | "publisher": "Azure SQL Developer Experiences Team",
8 | "licenseURL": "https://github.com/devcontainers/templates/blob/main/LICENSE",
9 | "options": {
10 | "imageVariant": {
11 | "type": "string",
12 | "description": "Node.js version:",
13 | "proposals": [
14 | "22-bookworm",
15 | "22-bullseye",
16 | "20-bookworm",
17 | "20-bullseye",
18 | "18-bookworm",
19 | "18-bullseye"
20 | ],
21 | "default": "22-bullseye"
22 | }
23 | },
24 | "platforms": [
25 | "Javascript",
26 | "Node.js",
27 | "Azure SQL Database"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/src/javascript-node/images/vscode-azure-sql-devcontainers-task-continue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/images/vscode-azure-sql-devcontainers-task-continue.png
--------------------------------------------------------------------------------
/src/javascript-node/images/vscode-azure-sql-devcontainers-task-list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/images/vscode-azure-sql-devcontainers-task-list.png
--------------------------------------------------------------------------------
/src/javascript-node/images/vscode-azure-sql-devcontainers-task-project-build.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/images/vscode-azure-sql-devcontainers-task-project-build.png
--------------------------------------------------------------------------------
/src/javascript-node/images/vscode-azure-sql-devcontainers-task-project-publish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/images/vscode-azure-sql-devcontainers-task-project-publish.png
--------------------------------------------------------------------------------
/src/javascript-node/images/vscode-azure-sql-devcontainers-task-sql-profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/images/vscode-azure-sql-devcontainers-task-sql-profile.png
--------------------------------------------------------------------------------
/src/javascript-node/images/vscode-azure-sql-devcontainers-task-sql-results.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/images/vscode-azure-sql-devcontainers-task-sql-results.png
--------------------------------------------------------------------------------
/src/javascript-node/images/vscode-azure-sql-devcontainers-task-sql-run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/images/vscode-azure-sql-devcontainers-task-sql-run.png
--------------------------------------------------------------------------------
/src/javascript-node/images/vscode-azure-sql-devcontainers-tasks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/javascript-node/images/vscode-azure-sql-devcontainers-tasks.png
--------------------------------------------------------------------------------
/src/javascript-node/scripts/verifyDatabase.sql:
--------------------------------------------------------------------------------
1 | -- Verifying database
2 | select * from library.dbo.authors;
3 | GO
4 | select * from library.dbo.books;
5 | GO
--------------------------------------------------------------------------------
/src/python/.devcontainer/.env:
--------------------------------------------------------------------------------
1 | MSSQL_SA_PASSWORD=P@ssw0rd!
--------------------------------------------------------------------------------
/src/python/.devcontainer/Dockerfile:
--------------------------------------------------------------------------------
1 | # [Choice] Python version: 3.12-bookworm, 3.11-bookworm, 3.10-bookworm and 3.12-bullseye, 3.11-bullseye, 3.10-bullseye
2 | FROM mcr.microsoft.com/devcontainers/python:1-${templateOption:imageVariant}
3 |
4 | # [Optional] Uncomment this section to install additional OS packages.
5 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
6 | && apt-get -y install --no-install-recommends software-properties-common
7 |
8 | # Install SQL Tools: SQLPackage, sqlcmd and drivers
9 | COPY sql/installSQLtools.sh installSQLtools.sh
10 | RUN bash ./installSQLtools.sh \
11 | && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
12 |
13 | # Install .NET SDK 8 (for SQL Database projects)
14 | COPY dotnet/install-dotnet.sh install-dotnet.sh
15 | RUN bash ./install-dotnet.sh \
16 | && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
--------------------------------------------------------------------------------
/src/python/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // For format details, see https://aka.ms/devcontainer.json.
2 | // For config options, see the README at: https://github.com/microsoft/azuresql-devcontainers/tree/main/src/python
3 | {
4 | "name": "Python and Azure SQL",
5 | "dockerComposeFile": "docker-compose.yml",
6 | "service": "app",
7 | "workspaceFolder": "/workspace",
8 | "customizations": {
9 | // Configure properties specific to VS Code.
10 | "vscode": {
11 | // Set *default* container specific settings.json values on container create.
12 | "settings": {
13 | "mssql.connections": [
14 | {
15 | "server": "localhost,1433",
16 | "database": "master",
17 | "authenticationType": "SqlLogin",
18 | "user": "sa",
19 | "password": "${env:MSSQL_SA_PASSWORD}",
20 | "savePassword": true,
21 | "profileName": "LocalDev",
22 | "trustServerCertificate": true
23 | }
24 | ],
25 | "sqlDatabaseProjects.dotnetSDK Location": "/usr/share/dotnet"
26 | },
27 | // Add the IDs of extensions you want installed when the container is created.
28 | "extensions": [
29 | "ms-python.python",
30 | "ms-python.vscode-pylance",
31 | "ms-vscode.vscode-node-azure-pack",
32 | "ms-azuretools.vscode-docker",
33 | "ms-mssql.mssql",
34 | "github.copilot",
35 | "github.codespaces"
36 | ]
37 | }
38 | },
39 |
40 | // Use 'forwardPorts' to make a list of ports inside the container available locally.
41 | "forwardPorts": [5000, 1433],
42 |
43 | // Post create commands to run after the container is created.
44 | "postCreateCommand": "bash .devcontainer/sql/postCreateCommand.sh 'database/Library/bin/Debug'",
45 |
46 | // Post start commands to run after the container is started.
47 |
48 | // Features to add to the dev container. More info: https://containers.dev/features.
49 | "features": {
50 | "ghcr.io/devcontainers/features/azure-cli:1": {
51 | "installBicep": true,
52 | "installUsingPython": true,
53 | "version": "latest"
54 | },
55 | "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
56 | "version": "latest"
57 | },
58 | "ghcr.io/azure/azure-dev/azd:latest": {
59 | "version": "latest"
60 | }
61 | }
62 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
63 | // "remoteUser": "root"
64 | }
--------------------------------------------------------------------------------
/src/python/.devcontainer/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 | app:
5 | build:
6 | context: .
7 | dockerfile: Dockerfile
8 |
9 | volumes:
10 | - ..:/workspace:cached
11 |
12 | # Overrides default command so things don't shut down after the process ends.
13 | command: sleep infinity
14 |
15 | # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
16 | network_mode: service:db
17 | # Uncomment the next line to use a non-root user for all processes.
18 | # user: vscode
19 |
20 | # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
21 | # (Adding the "ports" property to this file will not forward from a Codespace.)
22 |
23 | db:
24 | image: mcr.microsoft.com/azure-sql-edge
25 | hostname: SQL-Library
26 | container_name: SQL-Library
27 | restart: unless-stopped
28 | environment:
29 | ACCEPT_EULA: Y
30 | env_file:
31 | - .env
32 | deploy:
33 | resources:
34 | limits:
35 | cpus: '1'
36 | memory: 2048M
37 | # Add "forwardPorts": ["1433"] to **devcontainer.json** to forward MSSQL locally.
38 | # (Adding the "ports" property to this file will not forward from a Codespace.)
--------------------------------------------------------------------------------
/src/python/.devcontainer/dotnet/install-dotnet.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Installing .NET 8 (SDK) ..."
4 | wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
5 | sudo dpkg -i packages-microsoft-prod.deb
6 | rm packages-microsoft-prod.deb
7 |
8 | sudo apt-get update && \
9 | sudo apt-get install -y dotnet-sdk-8.0
--------------------------------------------------------------------------------
/src/python/.devcontainer/sql/installSQLtools.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Installing Go-SQLCmd ..."
4 | curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
5 | sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/prod.list)"
6 | sudo apt-get update
7 | sudo apt-get install -y sqlcmd
8 | echo "Go-SQLCmd installed."
9 |
10 | echo "Installing Sqlpackage ..."
11 | curl -sSL -o sqlpackage.zip "https://aka.ms/sqlpackage-linux"
12 | mkdir -p /opt/sqlpackage
13 | unzip sqlpackage.zip -d /opt/sqlpackage && rm sqlpackage.zip
14 | chmod a+x /opt/sqlpackage/sqlpackage
15 | echo "Sqlpackage installed."
16 |
17 | echo "Installing dependencies for SQL Server driver for Python..."
18 | sudo apt-get install -y unixodbc-dev
19 | echo "Dependencies installed."
20 |
21 | echo "Installing ODBC driver for SQL Server..."
22 | curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
23 | sudo curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list -o /etc/apt/sources.list.d/mssql-release.list
24 | sudo apt-get update
25 | sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17
26 | echo "ODBC driver for SQL Server installed."
27 |
28 | echo "Installing Python and pip..."
29 | sudo apt-get install -y python3 python3-pip
30 | echo "Python and pip installed."
31 |
32 | echo "Installing SQL Server driver for Python..."
33 | sudo pip3 install pyodbc
34 | echo "SQL Server driver for Python installed."
--------------------------------------------------------------------------------
/src/python/.devcontainer/sql/postCreateCommand.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Setting variables
4 | dacpac="false"
5 |
6 | # Load SA_PASSWORD from .env file
7 | export $(grep -v '^#' .devcontainer/.env | xargs)
8 | SApassword=$MSSQL_SA_PASSWORD
9 |
10 | # Parameters
11 | dacpath=$1
12 |
13 | # Extract the project directory from the dacpath
14 | projectDir=$(echo $dacpath | cut -d'/' -f1-2)
15 |
16 | echo "SELECT * FROM SYS.DATABASES" | dd of=testsqlconnection.sql
17 | for i in {1..30};
18 | do
19 | sqlcmd -S localhost -U sa -P $SApassword -d master -i testsqlconnection.sql > /dev/null
20 | if [ $? -eq 0 ]
21 | then
22 | echo "SQL server ready"
23 | break
24 | else
25 | echo "Not ready yet..."
26 | sleep 1
27 | fi
28 | done
29 | rm testsqlconnection.sql
30 |
31 | for f in $dacpath/*
32 | do
33 | if [ $f == $dacpath/*".dacpac" ]
34 | then
35 | dacpac="true"
36 | echo "Found dacpac $f"
37 | fi
38 | done
39 |
40 | if [ $dacpac == "true" ]
41 | then
42 | # Build the SQL Database project
43 | echo "Building SQL Database project at $projectDir..."
44 | dotnet build $projectDir
45 |
46 | for f in $dacpath/*
47 | do
48 | if [ $f == $dacpath/*".dacpac" ]
49 | then
50 | dbname=$(basename $f ".dacpac")
51 | # Deploy the dacpac
52 | echo "Deploying dacpac $f"
53 | /opt/sqlpackage/sqlpackage /Action:Publish /SourceFile:$f /TargetServerName:localhost /TargetDatabaseName:$dbname /TargetUser:sa /TargetPassword:$SApassword /TargetTrustServerCertificate:True
54 | fi
55 | done
56 | fi
--------------------------------------------------------------------------------
/src/python/.gitattributes:
--------------------------------------------------------------------------------
1 | # Git will always convert line endings to LF on checkout.
2 | # Used for files that must keep LF endings, even on Windows.
3 | *.sh text eol=lf
--------------------------------------------------------------------------------
/src/python/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the tasks.json format
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "label": "1. Verify database schema and data",
8 | "type": "shell",
9 | "command": "code",
10 | "args": [
11 | "--goto",
12 | "${workspaceFolder}/scripts/verifyDatabase.sql"
13 | ],
14 | "presentation": {
15 | "reveal": "always",
16 | "panel": "new"
17 | }
18 | },
19 | {
20 | "label": "2. Build SQL Database project",
21 | "type": "shell",
22 | "command": "dotnet build",
23 | "options": {
24 | "cwd": "${workspaceFolder}/database/Library"
25 | }
26 | },
27 | {
28 | "label": "3. Publish SQL Database project",
29 | "type": "shell",
30 | "command": "bash",
31 | "args": [
32 | ".devcontainer/sql/postCreateCommand.sh",
33 | "database/Library/bin/Debug"
34 | ]
35 | }
36 | ]
37 | }
--------------------------------------------------------------------------------
/src/python/database/Library/Library.sqlproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Library
6 | {478C0943-4ABE-4FFA-8797-721915EB2B70}
7 | Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider
8 | 1033, CI
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/python/database/Library/Sequences/globalId.sql:
--------------------------------------------------------------------------------
1 | CREATE SEQUENCE [dbo].[globalId]
2 | AS INT
3 | START WITH 1000000
4 | INCREMENT BY 1;
5 |
6 |
7 | GO
8 |
9 |
--------------------------------------------------------------------------------
/src/python/database/Library/StoredProcedures/stp_get_all_cowritten_books_by_author.sql:
--------------------------------------------------------------------------------
1 |
2 | create procedure dbo.stp_get_all_cowritten_books_by_author
3 | @author nvarchar(100),
4 | @searchType char(1) = 'c'
5 | as
6 |
7 | declare @authorSearchString nvarchar(110);
8 |
9 | if @searchType = 'c'
10 | set @authorSearchString = '%' + @author + '%' -- contains
11 | else if @searchType = 's'
12 | set @authorSearchString = @author + '%' -- startswith
13 | else
14 | throw 50000, '@searchType must be set to "c" or "s"', 16;
15 |
16 | with
17 | aggregated_authors
18 | as
19 | (
20 | select
21 | ba.book_id,
22 | string_agg(concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name), ', ') as authors,
23 | author_count = count(*)
24 | from
25 | dbo.books_authors ba
26 | inner join
27 | dbo.authors a on ba.author_id = a.id
28 | group by
29 | ba.book_id
30 | )
31 | select
32 | b.id,
33 | b.title,
34 | b.pages,
35 | b.[year],
36 | aa.authors
37 | from
38 | dbo.books b
39 | inner join
40 | aggregated_authors aa on b.id = aa.book_id
41 | inner join
42 | dbo.books_authors ba on b.id = ba.book_id
43 | inner join
44 | dbo.authors a on a.id = ba.author_id
45 | where
46 | aa.author_count > 1
47 | and
48 | (
49 | concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name) like @authorSearchString
50 | or
51 | concat(a.first_name, ' ', a.last_name) like @authorSearchString
52 | );
53 |
54 | GO
55 |
56 |
--------------------------------------------------------------------------------
/src/python/database/Library/Tables/authors.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[authors] (
2 | [id] INT DEFAULT (NEXT VALUE FOR [dbo].[globalId]) NOT NULL,
3 | [first_name] NVARCHAR (100) NOT NULL,
4 | [middle_name] NVARCHAR (100) NULL,
5 | [last_name] NVARCHAR (100) NOT NULL,
6 | PRIMARY KEY CLUSTERED ([id] ASC)
7 | );
8 |
9 |
10 | GO
11 |
12 |
--------------------------------------------------------------------------------
/src/python/database/Library/Tables/books.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[books] (
2 | [id] INT DEFAULT (NEXT VALUE FOR [dbo].[globalId]) NOT NULL,
3 | [title] NVARCHAR (1000) NOT NULL,
4 | [year] INT NULL,
5 | [pages] INT NULL,
6 | PRIMARY KEY CLUSTERED ([id] ASC)
7 | );
8 |
9 |
10 | GO
11 |
12 |
--------------------------------------------------------------------------------
/src/python/database/Library/Tables/books_authors.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[books_authors] (
2 | [author_id] INT NOT NULL,
3 | [book_id] INT NOT NULL,
4 | PRIMARY KEY CLUSTERED ([author_id] ASC, [book_id] ASC),
5 | FOREIGN KEY ([author_id]) REFERENCES [dbo].[authors] ([id]),
6 | FOREIGN KEY ([book_id]) REFERENCES [dbo].[books] ([id])
7 | );
8 |
9 |
10 | GO
11 |
12 | CREATE NONCLUSTERED INDEX [ixnc1]
13 | ON [dbo].[books_authors]([book_id] ASC, [author_id] ASC);
14 |
15 |
16 | GO
17 |
18 |
--------------------------------------------------------------------------------
/src/python/database/Library/Views/vw_books_details.sql:
--------------------------------------------------------------------------------
1 |
2 | create view dbo.vw_books_details
3 | as
4 | with
5 | aggregated_authors
6 | as
7 | (
8 | select
9 | ba.book_id,
10 | string_agg(concat(a.first_name, ' ', (a.middle_name + ' '), a.last_name), ', ') as authors
11 | from
12 | dbo.books_authors ba
13 | inner join
14 | dbo.authors a on ba.author_id = a.id
15 | group by
16 | ba.book_id
17 | )
18 | select
19 | b.id,
20 | b.title,
21 | b.pages,
22 | b.[year],
23 | aa.authors
24 | from
25 | dbo.books b
26 | inner join
27 | aggregated_authors aa on b.id = aa.book_id
28 |
29 | GO
30 |
31 |
--------------------------------------------------------------------------------
/src/python/database/Library/bin/Debug/Library.dacpac:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/database/Library/bin/Debug/Library.dacpac
--------------------------------------------------------------------------------
/src/python/database/Library/bin/Debug/Library.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/database/Library/bin/Debug/Library.dll
--------------------------------------------------------------------------------
/src/python/database/Library/bin/Debug/Library.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/database/Library/bin/Debug/Library.pdb
--------------------------------------------------------------------------------
/src/python/database/Library/obj/Debug/Library.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/database/Library/obj/Debug/Library.dll
--------------------------------------------------------------------------------
/src/python/database/Library/obj/Debug/Library.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/database/Library/obj/Debug/Library.pdb
--------------------------------------------------------------------------------
/src/python/database/Library/obj/Debug/Library.sqlproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.dacpac
2 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.dll
3 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/bin/Debug/Library.pdb
4 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Model.xml
5 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/refactor.xml
6 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/postdeploy.sql
7 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/predeploy.sql
8 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Library.dll
9 | /workspaces/azuresql-devcontainers/src/dotnet/database/Library/obj/Debug/Library.pdb
10 | /workspaces/azuresql-devcontainers/src/python/database/Library/bin/Debug/Library.dacpac
11 | /workspaces/azuresql-devcontainers/src/python/database/Library/bin/Debug/Library.dll
12 | /workspaces/azuresql-devcontainers/src/python/database/Library/bin/Debug/Library.pdb
13 | /workspaces/azuresql-devcontainers/src/python/database/Library/obj/Debug/Model.xml
14 | /workspaces/azuresql-devcontainers/src/python/database/Library/obj/Debug/refactor.xml
15 | /workspaces/azuresql-devcontainers/src/python/database/Library/obj/Debug/postdeploy.sql
16 | /workspaces/azuresql-devcontainers/src/python/database/Library/obj/Debug/predeploy.sql
17 | /workspaces/azuresql-devcontainers/src/python/database/Library/obj/Debug/Library.dll
18 | /workspaces/azuresql-devcontainers/src/python/database/Library/obj/Debug/Library.pdb
19 |
--------------------------------------------------------------------------------
/src/python/database/Library/obj/Library.sqlproj.nuget.dgspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "format": 1,
3 | "restore": {
4 | "/workspaces/azuresql-devcontainers/src/python/database/Library/Library.sqlproj": {}
5 | },
6 | "projects": {
7 | "/workspaces/azuresql-devcontainers/src/python/database/Library/Library.sqlproj": {
8 | "version": "1.0.0",
9 | "restore": {
10 | "projectUniqueName": "/workspaces/azuresql-devcontainers/src/python/database/Library/Library.sqlproj",
11 | "projectName": "Library",
12 | "projectPath": "/workspaces/azuresql-devcontainers/src/python/database/Library/Library.sqlproj",
13 | "packagesPath": "/home/codespace/.nuget/packages/",
14 | "outputPath": "/workspaces/azuresql-devcontainers/src/python/database/Library/obj/",
15 | "projectStyle": "PackageReference",
16 | "skipContentFileWrite": true,
17 | "configFilePaths": [
18 | "/home/codespace/.nuget/NuGet/NuGet.Config"
19 | ],
20 | "originalTargetFrameworks": [
21 | "net46"
22 | ],
23 | "sources": {
24 | "https://api.nuget.org/v3/index.json": {}
25 | },
26 | "frameworks": {
27 | "net46": {
28 | "projectReferences": {}
29 | }
30 | },
31 | "warningProperties": {
32 | "noWarn": [
33 | "NU5128"
34 | ]
35 | },
36 | "restoreAuditProperties": {
37 | "enableAudit": "true",
38 | "auditLevel": "low",
39 | "auditMode": "direct"
40 | }
41 | },
42 | "frameworks": {
43 | "net46": {
44 | "dependencies": {
45 | "Microsoft.NETFramework.ReferenceAssemblies": {
46 | "suppressParent": "All",
47 | "target": "Package",
48 | "version": "[1.0.0, )"
49 | }
50 | }
51 | }
52 | }
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/src/python/database/Library/obj/Library.sqlproj.nuget.g.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | True
5 | NuGet
6 | $(MSBuildThisFileDirectory)project.assets.json
7 | /home/codespace/.nuget/packages/
8 | /home/codespace/.nuget/packages/
9 | PackageReference
10 | 6.10.0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/python/database/Library/obj/Library.sqlproj.nuget.g.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/python/database/Library/obj/project.nuget.cache:
--------------------------------------------------------------------------------
1 | {
2 | "version": 2,
3 | "dgSpecHash": "NbP7E5jC1/Q=",
4 | "success": true,
5 | "projectFilePath": "/workspaces/azuresql-devcontainers/src/python/database/Library/Library.sqlproj",
6 | "expectedPackageFiles": [
7 | "/home/codespace/.nuget/packages/microsoft.netframework.referenceassemblies/1.0.0/microsoft.netframework.referenceassemblies.1.0.0.nupkg.sha512",
8 | "/home/codespace/.nuget/packages/microsoft.netframework.referenceassemblies.net46/1.0.0/microsoft.netframework.referenceassemblies.net46.1.0.0.nupkg.sha512"
9 | ],
10 | "logs": []
11 | }
--------------------------------------------------------------------------------
/src/python/devcontainer-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "python",
3 | "version": "1.2.2",
4 | "name": "Python and Azure SQL",
5 | "description": "A development environment for Python and Azure SQL, enabling streamlined local development and testing.",
6 | "documentationURL": "https://github.com/microsoft/azuresql-devcontainers/tree/main/src/python",
7 | "publisher": "Azure SQL Developer Experiences Team",
8 | "licenseURL": "https://github.com/devcontainers/templates/blob/main/LICENSE",
9 | "options": {
10 | "imageVariant": {
11 | "type": "string",
12 | "description": "Python version:",
13 | "proposals": [
14 | "3.10-bookworm",
15 | "3.11-bookworm",
16 | "3.12-bookworm",
17 | "3.10-bullseye",
18 | "3.11-bullseye",
19 | "3.12-bullseye"
20 | ],
21 | "default": "3.12-bullseye"
22 | }
23 | },
24 | "platforms": [
25 | "Python",
26 | "Azure SQL Database"
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/src/python/images/vscode-azure-sql-devcontainers-task-continue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/images/vscode-azure-sql-devcontainers-task-continue.png
--------------------------------------------------------------------------------
/src/python/images/vscode-azure-sql-devcontainers-task-list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/images/vscode-azure-sql-devcontainers-task-list.png
--------------------------------------------------------------------------------
/src/python/images/vscode-azure-sql-devcontainers-task-project-build.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/images/vscode-azure-sql-devcontainers-task-project-build.png
--------------------------------------------------------------------------------
/src/python/images/vscode-azure-sql-devcontainers-task-project-publish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/images/vscode-azure-sql-devcontainers-task-project-publish.png
--------------------------------------------------------------------------------
/src/python/images/vscode-azure-sql-devcontainers-task-sql-profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/images/vscode-azure-sql-devcontainers-task-sql-profile.png
--------------------------------------------------------------------------------
/src/python/images/vscode-azure-sql-devcontainers-task-sql-results.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/images/vscode-azure-sql-devcontainers-task-sql-results.png
--------------------------------------------------------------------------------
/src/python/images/vscode-azure-sql-devcontainers-task-sql-run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/images/vscode-azure-sql-devcontainers-task-sql-run.png
--------------------------------------------------------------------------------
/src/python/images/vscode-azure-sql-devcontainers-tasks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/src/python/images/vscode-azure-sql-devcontainers-tasks.png
--------------------------------------------------------------------------------
/src/python/scripts/verifyDatabase.sql:
--------------------------------------------------------------------------------
1 | -- Verifying database
2 | select * from library.dbo.authors;
3 | GO
4 | select * from library.dbo.books;
5 | GO
--------------------------------------------------------------------------------
/test/dotnet-aspire/Program.cs:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4 | *-------------------------------------------------------------------------------------------------------------*/
5 |
6 | using System;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.AspNetCore.Builder;
9 | using Microsoft.AspNetCore.Http;
10 | using Microsoft.Data.SqlClient;
11 |
12 | namespace aspnetapp
13 | {
14 | public class Program
15 | {
16 | public static void Main(string[] args)
17 | {
18 | string databaseNames = "";
19 | SqlConnectionStringBuilder connectionBuilder = new SqlConnectionStringBuilder();
20 |
21 | connectionBuilder.DataSource = "localhost,1433";
22 | connectionBuilder.UserID = "sa";
23 | connectionBuilder.Password = "P@ssw0rd!";
24 | using (SqlConnection containerConnection = new SqlConnection(connectionBuilder.ConnectionString)) {
25 | containerConnection.Open();
26 | string tsql = "SELECT [NAME] AS DBNAME FROM SYS.DATABASES";
27 |
28 | using (SqlCommand tsqlCommand = new SqlCommand(tsql, containerConnection)) {
29 | using (SqlDataReader reader = tsqlCommand.ExecuteReader()) {
30 | int rowcount = 0;
31 | while (reader.Read()) {
32 | if (rowcount == 0) {
33 | databaseNames += reader.GetString(0);
34 | } else {
35 | databaseNames = reader.GetString(0) + "," + databaseNames;
36 | }
37 | rowcount += 1;
38 | }
39 | }
40 | }
41 | }
42 | var host = new WebHostBuilder()
43 | .UseKestrel()
44 | .UseUrls("http://0.0.0.0:8090")
45 | .Configure(app => app.Run(async context => {
46 | string responseText = "The databases are: " + databaseNames;
47 | Console.WriteLine(responseText); // Log to console
48 | await context.Response.WriteAsync(responseText); // Send to client
49 | }))
50 | .Build();
51 |
52 | host.Run();
53 | }
54 |
55 | }
56 | }
--------------------------------------------------------------------------------
/test/dotnet-aspire/aspnetapp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net8.0
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/test/dotnet-aspire/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
5 |
--------------------------------------------------------------------------------
/test/dotnet-aspire/obj/Debug/net8.0/aspnetapp.AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Reflection;
12 |
13 | [assembly: System.Reflection.AssemblyCompanyAttribute("aspnetapp")]
14 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
15 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
16 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+33647733a5604e8dbe7c5368344715c98bec67ab")]
17 | [assembly: System.Reflection.AssemblyProductAttribute("aspnetapp")]
18 | [assembly: System.Reflection.AssemblyTitleAttribute("aspnetapp")]
19 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
20 |
21 | // Generated by the MSBuild WriteCodeFragment class.
22 |
23 |
--------------------------------------------------------------------------------
/test/dotnet-aspire/obj/Debug/net8.0/aspnetapp.AssemblyInfoInputs.cache:
--------------------------------------------------------------------------------
1 | aa9fb73e9cdd6b92e05b28d0d6c5672e135c8a97115b18f3253289b6b43836fe
2 |
--------------------------------------------------------------------------------
/test/dotnet-aspire/obj/Debug/net8.0/aspnetapp.GeneratedMSBuildEditorConfig.editorconfig:
--------------------------------------------------------------------------------
1 | is_global = true
2 | build_property.TargetFramework = net8.0
3 | build_property.TargetPlatformMinVersion =
4 | build_property.UsingMicrosoftNETSdkWeb = true
5 | build_property.ProjectTypeGuids =
6 | build_property.InvariantGlobalization =
7 | build_property.PlatformNeutralAssembly =
8 | build_property.EnforceExtendedAnalyzerRules =
9 | build_property._SupportedPlatformList = Linux,macOS,Windows
10 | build_property.RootNamespace = aspnetapp
11 | build_property.RootNamespace = aspnetapp
12 | build_property.ProjectDir = /workspaces/azuresql-devcontainers/test/dotnet-aspire/
13 | build_property.EnableComHosting =
14 | build_property.EnableGeneratedComInterfaceComImportInterop =
15 | build_property.RazorLangVersion = 8.0
16 | build_property.SupportLocalizedComponentNames =
17 | build_property.GenerateRazorMetadataSourceChecksumAttributes =
18 | build_property.MSBuildProjectDirectory = /workspaces/azuresql-devcontainers/test/dotnet-aspire
19 | build_property._RazorSourceGeneratorDebug =
20 |
--------------------------------------------------------------------------------
/test/dotnet-aspire/obj/Debug/net8.0/aspnetapp.assets.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet-aspire/obj/Debug/net8.0/aspnetapp.assets.cache
--------------------------------------------------------------------------------
/test/dotnet-aspire/obj/Debug/net8.0/aspnetapp.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet-aspire/obj/Debug/net8.0/aspnetapp.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/test/dotnet-aspire/obj/aspnetapp.csproj.nuget.dgspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "format": 1,
3 | "restore": {
4 | "/workspaces/azuresql-devcontainers/test/dotnet-aspire/aspnetapp.csproj": {}
5 | },
6 | "projects": {
7 | "/workspaces/azuresql-devcontainers/test/dotnet-aspire/aspnetapp.csproj": {
8 | "version": "1.0.0",
9 | "restore": {
10 | "projectUniqueName": "/workspaces/azuresql-devcontainers/test/dotnet-aspire/aspnetapp.csproj",
11 | "projectName": "aspnetapp",
12 | "projectPath": "/workspaces/azuresql-devcontainers/test/dotnet-aspire/aspnetapp.csproj",
13 | "packagesPath": "/home/codespace/.nuget/packages/",
14 | "outputPath": "/workspaces/azuresql-devcontainers/test/dotnet-aspire/obj/",
15 | "projectStyle": "PackageReference",
16 | "configFilePaths": [
17 | "/home/codespace/.nuget/NuGet/NuGet.Config"
18 | ],
19 | "originalTargetFrameworks": [
20 | "net8.0"
21 | ],
22 | "sources": {
23 | "https://api.nuget.org/v3/index.json": {}
24 | },
25 | "frameworks": {
26 | "net8.0": {
27 | "targetAlias": "net8.0",
28 | "projectReferences": {}
29 | }
30 | },
31 | "warningProperties": {
32 | "warnAsError": [
33 | "NU1605"
34 | ]
35 | },
36 | "restoreAuditProperties": {
37 | "enableAudit": "true",
38 | "auditLevel": "low",
39 | "auditMode": "direct"
40 | }
41 | },
42 | "frameworks": {
43 | "net8.0": {
44 | "targetAlias": "net8.0",
45 | "dependencies": {
46 | "Microsoft.Data.SqlClient": {
47 | "target": "Package",
48 | "version": "[3.1.5, )"
49 | }
50 | },
51 | "imports": [
52 | "net461",
53 | "net462",
54 | "net47",
55 | "net471",
56 | "net472",
57 | "net48",
58 | "net481"
59 | ],
60 | "assetTargetFallback": true,
61 | "warn": true,
62 | "frameworkReferences": {
63 | "Microsoft.AspNetCore.App": {
64 | "privateAssets": "none"
65 | },
66 | "Microsoft.NETCore.App": {
67 | "privateAssets": "all"
68 | }
69 | },
70 | "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/8.0.301/PortableRuntimeIdentifierGraph.json"
71 | }
72 | }
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/test/dotnet-aspire/obj/aspnetapp.csproj.nuget.g.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | True
5 | NuGet
6 | $(MSBuildThisFileDirectory)project.assets.json
7 | /home/codespace/.nuget/packages/
8 | /home/codespace/.nuget/packages/
9 | PackageReference
10 | 6.10.0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test/dotnet-aspire/obj/aspnetapp.csproj.nuget.g.targets:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test/dotnet-aspire/obj/project.nuget.cache:
--------------------------------------------------------------------------------
1 | {
2 | "version": 2,
3 | "dgSpecHash": "rpB489y3YMk=",
4 | "success": true,
5 | "projectFilePath": "/workspaces/azuresql-devcontainers/test/dotnet-aspire/aspnetapp.csproj",
6 | "expectedPackageFiles": [
7 | "/home/codespace/.nuget/packages/azure.core/1.6.0/azure.core.1.6.0.nupkg.sha512",
8 | "/home/codespace/.nuget/packages/azure.identity/1.3.0/azure.identity.1.3.0.nupkg.sha512",
9 | "/home/codespace/.nuget/packages/microsoft.bcl.asyncinterfaces/1.0.0/microsoft.bcl.asyncinterfaces.1.0.0.nupkg.sha512",
10 | "/home/codespace/.nuget/packages/microsoft.csharp/4.5.0/microsoft.csharp.4.5.0.nupkg.sha512",
11 | "/home/codespace/.nuget/packages/microsoft.data.sqlclient/3.1.5/microsoft.data.sqlclient.3.1.5.nupkg.sha512",
12 | "/home/codespace/.nuget/packages/microsoft.data.sqlclient.sni.runtime/3.0.1/microsoft.data.sqlclient.sni.runtime.3.0.1.nupkg.sha512",
13 | "/home/codespace/.nuget/packages/microsoft.identity.client/4.22.0/microsoft.identity.client.4.22.0.nupkg.sha512",
14 | "/home/codespace/.nuget/packages/microsoft.identity.client.extensions.msal/2.16.5/microsoft.identity.client.extensions.msal.2.16.5.nupkg.sha512",
15 | "/home/codespace/.nuget/packages/microsoft.identitymodel.jsonwebtokens/6.8.0/microsoft.identitymodel.jsonwebtokens.6.8.0.nupkg.sha512",
16 | "/home/codespace/.nuget/packages/microsoft.identitymodel.logging/6.8.0/microsoft.identitymodel.logging.6.8.0.nupkg.sha512",
17 | "/home/codespace/.nuget/packages/microsoft.identitymodel.protocols/6.8.0/microsoft.identitymodel.protocols.6.8.0.nupkg.sha512",
18 | "/home/codespace/.nuget/packages/microsoft.identitymodel.protocols.openidconnect/6.8.0/microsoft.identitymodel.protocols.openidconnect.6.8.0.nupkg.sha512",
19 | "/home/codespace/.nuget/packages/microsoft.identitymodel.tokens/6.8.0/microsoft.identitymodel.tokens.6.8.0.nupkg.sha512",
20 | "/home/codespace/.nuget/packages/microsoft.netcore.platforms/3.1.0/microsoft.netcore.platforms.3.1.0.nupkg.sha512",
21 | "/home/codespace/.nuget/packages/microsoft.win32.registry/4.7.0/microsoft.win32.registry.4.7.0.nupkg.sha512",
22 | "/home/codespace/.nuget/packages/microsoft.win32.systemevents/4.7.0/microsoft.win32.systemevents.4.7.0.nupkg.sha512",
23 | "/home/codespace/.nuget/packages/system.buffers/4.5.0/system.buffers.4.5.0.nupkg.sha512",
24 | "/home/codespace/.nuget/packages/system.configuration.configurationmanager/4.7.0/system.configuration.configurationmanager.4.7.0.nupkg.sha512",
25 | "/home/codespace/.nuget/packages/system.diagnostics.diagnosticsource/4.7.0/system.diagnostics.diagnosticsource.4.7.0.nupkg.sha512",
26 | "/home/codespace/.nuget/packages/system.drawing.common/4.7.0/system.drawing.common.4.7.0.nupkg.sha512",
27 | "/home/codespace/.nuget/packages/system.identitymodel.tokens.jwt/6.8.0/system.identitymodel.tokens.jwt.6.8.0.nupkg.sha512",
28 | "/home/codespace/.nuget/packages/system.memory/4.5.3/system.memory.4.5.3.nupkg.sha512",
29 | "/home/codespace/.nuget/packages/system.numerics.vectors/4.5.0/system.numerics.vectors.4.5.0.nupkg.sha512",
30 | "/home/codespace/.nuget/packages/system.runtime.caching/4.7.0/system.runtime.caching.4.7.0.nupkg.sha512",
31 | "/home/codespace/.nuget/packages/system.security.accesscontrol/4.7.0/system.security.accesscontrol.4.7.0.nupkg.sha512",
32 | "/home/codespace/.nuget/packages/system.security.cryptography.cng/4.5.0/system.security.cryptography.cng.4.5.0.nupkg.sha512",
33 | "/home/codespace/.nuget/packages/system.security.cryptography.protecteddata/4.7.0/system.security.cryptography.protecteddata.4.7.0.nupkg.sha512",
34 | "/home/codespace/.nuget/packages/system.security.permissions/4.7.0/system.security.permissions.4.7.0.nupkg.sha512",
35 | "/home/codespace/.nuget/packages/system.security.principal.windows/4.7.0/system.security.principal.windows.4.7.0.nupkg.sha512",
36 | "/home/codespace/.nuget/packages/system.text.encoding.codepages/4.7.0/system.text.encoding.codepages.4.7.0.nupkg.sha512",
37 | "/home/codespace/.nuget/packages/system.text.encodings.web/4.7.2/system.text.encodings.web.4.7.2.nupkg.sha512",
38 | "/home/codespace/.nuget/packages/system.text.json/4.6.0/system.text.json.4.6.0.nupkg.sha512",
39 | "/home/codespace/.nuget/packages/system.threading.tasks.extensions/4.5.2/system.threading.tasks.extensions.4.5.2.nupkg.sha512",
40 | "/home/codespace/.nuget/packages/system.windows.extensions/4.7.0/system.windows.extensions.4.7.0.nupkg.sha512"
41 | ],
42 | "logs": []
43 | }
--------------------------------------------------------------------------------
/test/dotnet-aspire/test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd $(dirname "$0")
3 |
4 | source test-utils.sh vscode
5 |
6 | # Remote - Containers does not auto-sync UID/GID for Docker Compose,
7 | # so make sure test project prvs match the non-root user in the container.
8 | fixTestProjectFolderPrivs
9 |
10 | # Run common tests
11 | checkCommon
12 |
13 | # template specific tests
14 | checkExtension "ms-dotnettools.csharp"
15 | checkExtension "ms-mssql.mssql"
16 | check "dotnet" dotnet --info
17 | check "nuget" dotnet restore
18 | check "msbuild" dotnet msbuild
19 | rm -rf ./obj ./bin
20 | rm -rf /workspaces/azuresql-devcontainers/azuresql-devcontainers.sln
21 | check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
22 | check "nvm-node" bash -c ". /usr/local/share/nvm/nvm.sh && node --version"
23 | check "yarn" bash -c ". /usr/local/share/nvm/nvm.sh && yarn --version"
24 |
25 | # Report result
26 | reportResults
--------------------------------------------------------------------------------
/test/dotnet/Program.cs:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4 | *-------------------------------------------------------------------------------------------------------------*/
5 |
6 | using System;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.AspNetCore.Builder;
9 | using Microsoft.AspNetCore.Http;
10 | using Microsoft.Data.SqlClient;
11 |
12 | namespace aspnetapp
13 | {
14 | public class Program
15 | {
16 | public static void Main(string[] args)
17 | {
18 | string databaseNames = "";
19 | SqlConnectionStringBuilder connectionBuilder = new SqlConnectionStringBuilder();
20 |
21 | connectionBuilder.DataSource = "localhost,1433";
22 | connectionBuilder.UserID = "sa";
23 | connectionBuilder.Password = "P@ssw0rd!";
24 | using (SqlConnection containerConnection = new SqlConnection(connectionBuilder.ConnectionString)) {
25 | containerConnection.Open();
26 | string tsql = "SELECT [NAME] AS DBNAME FROM SYS.DATABASES";
27 |
28 | using (SqlCommand tsqlCommand = new SqlCommand(tsql, containerConnection)) {
29 | using (SqlDataReader reader = tsqlCommand.ExecuteReader()) {
30 | int rowcount = 0;
31 | while (reader.Read()) {
32 | if (rowcount == 0) {
33 | databaseNames += reader.GetString(0);
34 | } else {
35 | databaseNames = reader.GetString(0) + "," + databaseNames;
36 | }
37 | rowcount += 1;
38 | }
39 | }
40 | }
41 | }
42 | var host = new WebHostBuilder()
43 | .UseKestrel()
44 | .UseUrls("http://0.0.0.0:8090")
45 | .Configure(app => app.Run(async context => {
46 | string responseText = "The databases are: " + databaseNames;
47 | Console.WriteLine(responseText); // Log to console
48 | await context.Response.WriteAsync(responseText); // Send to client
49 | }))
50 | .Build();
51 |
52 | host.Run();
53 | }
54 |
55 | }
56 | }
--------------------------------------------------------------------------------
/test/dotnet/aspnetapp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net8.0
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Azure.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Azure.Core.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Azure.Identity.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Azure.Identity.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Microsoft.Data.SqlClient.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Microsoft.Data.SqlClient.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Microsoft.Identity.Client.Extensions.Msal.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Microsoft.Identity.Client.Extensions.Msal.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Microsoft.Identity.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Microsoft.Identity.Client.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Logging.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Logging.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Protocols.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Protocols.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Tokens.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Tokens.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/Microsoft.Win32.SystemEvents.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/Microsoft.Win32.SystemEvents.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/System.Configuration.ConfigurationManager.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/System.Configuration.ConfigurationManager.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/System.Drawing.Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/System.Drawing.Common.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/System.IdentityModel.Tokens.Jwt.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/System.IdentityModel.Tokens.Jwt.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/System.Runtime.Caching.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/System.Runtime.Caching.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/System.Security.Cryptography.ProtectedData.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/System.Security.Cryptography.ProtectedData.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/System.Security.Permissions.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/System.Security.Permissions.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/System.Windows.Extensions.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/System.Windows.Extensions.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/aspnetapp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/aspnetapp
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/aspnetapp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/aspnetapp.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/aspnetapp.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/aspnetapp.pdb
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/aspnetapp.runtimeconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "runtimeOptions": {
3 | "tfm": "net8.0",
4 | "frameworks": [
5 | {
6 | "name": "Microsoft.NETCore.App",
7 | "version": "8.0.0"
8 | },
9 | {
10 | "name": "Microsoft.AspNetCore.App",
11 | "version": "8.0.0"
12 | }
13 | ],
14 | "configProperties": {
15 | "System.GC.Server": true,
16 | "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/unix/lib/netcoreapp3.0/System.Drawing.Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/unix/lib/netcoreapp3.0/System.Drawing.Common.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/unix/lib/netcoreapp3.1/Microsoft.Data.SqlClient.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/unix/lib/netcoreapp3.1/Microsoft.Data.SqlClient.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/win-arm/native/Microsoft.Data.SqlClient.SNI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/win-arm/native/Microsoft.Data.SqlClient.SNI.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/win-arm64/native/Microsoft.Data.SqlClient.SNI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/win-arm64/native/Microsoft.Data.SqlClient.SNI.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/win-x86/native/Microsoft.Data.SqlClient.SNI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/win-x86/native/Microsoft.Data.SqlClient.SNI.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.0/Microsoft.Win32.SystemEvents.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.0/Microsoft.Win32.SystemEvents.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.0/System.Drawing.Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.0/System.Drawing.Common.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.0/System.Windows.Extensions.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.0/System.Windows.Extensions.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.1/Microsoft.Data.SqlClient.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.1/Microsoft.Data.SqlClient.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netstandard2.0/System.Runtime.Caching.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netstandard2.0/System.Runtime.Caching.dll
--------------------------------------------------------------------------------
/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
5 |
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/apphost:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/obj/Debug/net8.0/apphost
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Reflection;
12 |
13 | [assembly: System.Reflection.AssemblyCompanyAttribute("aspnetapp")]
14 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
15 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
16 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+33647733a5604e8dbe7c5368344715c98bec67ab")]
17 | [assembly: System.Reflection.AssemblyProductAttribute("aspnetapp")]
18 | [assembly: System.Reflection.AssemblyTitleAttribute("aspnetapp")]
19 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
20 |
21 | // Generated by the MSBuild WriteCodeFragment class.
22 |
23 |
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.AssemblyInfoInputs.cache:
--------------------------------------------------------------------------------
1 | aa9fb73e9cdd6b92e05b28d0d6c5672e135c8a97115b18f3253289b6b43836fe
2 |
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.GeneratedMSBuildEditorConfig.editorconfig:
--------------------------------------------------------------------------------
1 | is_global = true
2 | build_property.TargetFramework = net8.0
3 | build_property.TargetPlatformMinVersion =
4 | build_property.UsingMicrosoftNETSdkWeb = true
5 | build_property.ProjectTypeGuids =
6 | build_property.InvariantGlobalization =
7 | build_property.PlatformNeutralAssembly =
8 | build_property.EnforceExtendedAnalyzerRules =
9 | build_property._SupportedPlatformList = Linux,macOS,Windows
10 | build_property.RootNamespace = aspnetapp
11 | build_property.RootNamespace = aspnetapp
12 | build_property.ProjectDir = /workspaces/azuresql-devcontainers/test/dotnet/
13 | build_property.EnableComHosting =
14 | build_property.EnableGeneratedComInterfaceComImportInterop =
15 | build_property.RazorLangVersion = 8.0
16 | build_property.SupportLocalizedComponentNames =
17 | build_property.GenerateRazorMetadataSourceChecksumAttributes =
18 | build_property.MSBuildProjectDirectory = /workspaces/azuresql-devcontainers/test/dotnet
19 | build_property._RazorSourceGeneratorDebug =
20 |
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.MvcApplicationPartsAssemblyInfo.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/obj/Debug/net8.0/aspnetapp.MvcApplicationPartsAssemblyInfo.cache
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.assets.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/obj/Debug/net8.0/aspnetapp.assets.cache
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/obj/Debug/net8.0/aspnetapp.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 7108b1e55babb2192b844fb7cf951632e2a5798c9ad21f148fe53d51a773689e
2 |
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/aspnetapp
2 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/aspnetapp.deps.json
3 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/aspnetapp.runtimeconfig.json
4 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/aspnetapp.dll
5 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/aspnetapp.pdb
6 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Azure.Core.dll
7 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Azure.Identity.dll
8 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll
9 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Microsoft.Data.SqlClient.dll
10 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Microsoft.Identity.Client.dll
11 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Microsoft.Identity.Client.Extensions.Msal.dll
12 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll
13 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Logging.dll
14 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Protocols.dll
15 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
16 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Microsoft.IdentityModel.Tokens.dll
17 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/Microsoft.Win32.SystemEvents.dll
18 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/System.Configuration.ConfigurationManager.dll
19 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/System.Drawing.Common.dll
20 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/System.IdentityModel.Tokens.Jwt.dll
21 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/System.Runtime.Caching.dll
22 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/System.Security.Cryptography.ProtectedData.dll
23 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/System.Security.Permissions.dll
24 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/System.Windows.Extensions.dll
25 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/unix/lib/netcoreapp3.1/Microsoft.Data.SqlClient.dll
26 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.1/Microsoft.Data.SqlClient.dll
27 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/win-arm/native/Microsoft.Data.SqlClient.SNI.dll
28 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/win-arm64/native/Microsoft.Data.SqlClient.SNI.dll
29 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll
30 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/win-x86/native/Microsoft.Data.SqlClient.SNI.dll
31 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.0/Microsoft.Win32.SystemEvents.dll
32 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/unix/lib/netcoreapp3.0/System.Drawing.Common.dll
33 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.0/System.Drawing.Common.dll
34 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netstandard2.0/System.Runtime.Caching.dll
35 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll
36 | /workspaces/azuresql-devcontainers/test/dotnet/bin/Debug/net8.0/runtimes/win/lib/netcoreapp3.0/System.Windows.Extensions.dll
37 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.csproj.AssemblyReference.cache
38 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.GeneratedMSBuildEditorConfig.editorconfig
39 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.AssemblyInfoInputs.cache
40 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.AssemblyInfo.cs
41 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.csproj.CoreCompileInputs.cache
42 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.MvcApplicationPartsAssemblyInfo.cache
43 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.sourcelink.json
44 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/staticwebassets.build.json
45 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/staticwebassets.development.json
46 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/staticwebassets/msbuild.aspnetapp.Microsoft.AspNetCore.StaticWebAssets.props
47 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/staticwebassets/msbuild.build.aspnetapp.props
48 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/staticwebassets/msbuild.buildMultiTargeting.aspnetapp.props
49 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/staticwebassets/msbuild.buildTransitive.aspnetapp.props
50 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/staticwebassets.pack.json
51 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/scopedcss/bundle/aspnetapp.styles.css
52 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.csproj.Up2Date
53 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.dll
54 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/refint/aspnetapp.dll
55 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.pdb
56 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/aspnetapp.genruntimeconfig.cache
57 | /workspaces/azuresql-devcontainers/test/dotnet/obj/Debug/net8.0/ref/aspnetapp.dll
58 |
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.csproj.Up2Date:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/obj/Debug/net8.0/aspnetapp.csproj.Up2Date
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/obj/Debug/net8.0/aspnetapp.dll
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.genruntimeconfig.cache:
--------------------------------------------------------------------------------
1 | 6d34a2320a0dfe452c184e47a6dbf8f5c6174d298d5340e64f00f390d0e3e387
2 |
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/obj/Debug/net8.0/aspnetapp.pdb
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/aspnetapp.sourcelink.json:
--------------------------------------------------------------------------------
1 | {"documents":{"/workspaces/azuresql-devcontainers/*":"https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/6b63c86964252aae93d2225e26186cb031bdb14d/*"}}
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/ref/aspnetapp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/obj/Debug/net8.0/ref/aspnetapp.dll
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/refint/aspnetapp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/azuresql-devcontainers/9a03f6405e4dc97ed583fdbcbce04e0750524aab/test/dotnet/obj/Debug/net8.0/refint/aspnetapp.dll
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/staticwebassets.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": 1,
3 | "Hash": "rDCW86W4EVssBZtmcRTKrI9gegpXLaD59M5+zpqUdwQ=",
4 | "Source": "aspnetapp",
5 | "BasePath": "_content/aspnetapp",
6 | "Mode": "Default",
7 | "ManifestType": "Build",
8 | "ReferencedProjectsConfiguration": [],
9 | "DiscoveryPatterns": [],
10 | "Assets": []
11 | }
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/staticwebassets/msbuild.build.aspnetapp.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/staticwebassets/msbuild.buildMultiTargeting.aspnetapp.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/dotnet/obj/Debug/net8.0/staticwebassets/msbuild.buildTransitive.aspnetapp.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/dotnet/obj/aspnetapp.csproj.nuget.dgspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "format": 1,
3 | "restore": {
4 | "/workspaces/azuresql-devcontainers/test/dotnet/aspnetapp.csproj": {}
5 | },
6 | "projects": {
7 | "/workspaces/azuresql-devcontainers/test/dotnet/aspnetapp.csproj": {
8 | "version": "1.0.0",
9 | "restore": {
10 | "projectUniqueName": "/workspaces/azuresql-devcontainers/test/dotnet/aspnetapp.csproj",
11 | "projectName": "aspnetapp",
12 | "projectPath": "/workspaces/azuresql-devcontainers/test/dotnet/aspnetapp.csproj",
13 | "packagesPath": "/home/codespace/.nuget/packages/",
14 | "outputPath": "/workspaces/azuresql-devcontainers/test/dotnet/obj/",
15 | "projectStyle": "PackageReference",
16 | "configFilePaths": [
17 | "/home/codespace/.nuget/NuGet/NuGet.Config"
18 | ],
19 | "originalTargetFrameworks": [
20 | "net8.0"
21 | ],
22 | "sources": {
23 | "https://api.nuget.org/v3/index.json": {}
24 | },
25 | "frameworks": {
26 | "net8.0": {
27 | "targetAlias": "net8.0",
28 | "projectReferences": {}
29 | }
30 | },
31 | "warningProperties": {
32 | "warnAsError": [
33 | "NU1605"
34 | ]
35 | },
36 | "restoreAuditProperties": {
37 | "enableAudit": "true",
38 | "auditLevel": "low",
39 | "auditMode": "direct"
40 | }
41 | },
42 | "frameworks": {
43 | "net8.0": {
44 | "targetAlias": "net8.0",
45 | "dependencies": {
46 | "Microsoft.Data.SqlClient": {
47 | "target": "Package",
48 | "version": "[3.1.5, )"
49 | }
50 | },
51 | "imports": [
52 | "net461",
53 | "net462",
54 | "net47",
55 | "net471",
56 | "net472",
57 | "net48",
58 | "net481"
59 | ],
60 | "assetTargetFallback": true,
61 | "warn": true,
62 | "frameworkReferences": {
63 | "Microsoft.AspNetCore.App": {
64 | "privateAssets": "none"
65 | },
66 | "Microsoft.NETCore.App": {
67 | "privateAssets": "all"
68 | }
69 | },
70 | "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/8.0.301/PortableRuntimeIdentifierGraph.json"
71 | }
72 | }
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/test/dotnet/obj/aspnetapp.csproj.nuget.g.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | True
5 | NuGet
6 | $(MSBuildThisFileDirectory)project.assets.json
7 | /home/codespace/.nuget/packages/
8 | /home/codespace/.nuget/packages/
9 | PackageReference
10 | 6.10.0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test/dotnet/obj/aspnetapp.csproj.nuget.g.targets:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test/dotnet/obj/project.nuget.cache:
--------------------------------------------------------------------------------
1 | {
2 | "version": 2,
3 | "dgSpecHash": "a3mZ4ekKFog=",
4 | "success": true,
5 | "projectFilePath": "/workspaces/azuresql-devcontainers/test/dotnet/aspnetapp.csproj",
6 | "expectedPackageFiles": [
7 | "/home/codespace/.nuget/packages/azure.core/1.6.0/azure.core.1.6.0.nupkg.sha512",
8 | "/home/codespace/.nuget/packages/azure.identity/1.3.0/azure.identity.1.3.0.nupkg.sha512",
9 | "/home/codespace/.nuget/packages/microsoft.bcl.asyncinterfaces/1.0.0/microsoft.bcl.asyncinterfaces.1.0.0.nupkg.sha512",
10 | "/home/codespace/.nuget/packages/microsoft.csharp/4.5.0/microsoft.csharp.4.5.0.nupkg.sha512",
11 | "/home/codespace/.nuget/packages/microsoft.data.sqlclient/3.1.5/microsoft.data.sqlclient.3.1.5.nupkg.sha512",
12 | "/home/codespace/.nuget/packages/microsoft.data.sqlclient.sni.runtime/3.0.1/microsoft.data.sqlclient.sni.runtime.3.0.1.nupkg.sha512",
13 | "/home/codespace/.nuget/packages/microsoft.identity.client/4.22.0/microsoft.identity.client.4.22.0.nupkg.sha512",
14 | "/home/codespace/.nuget/packages/microsoft.identity.client.extensions.msal/2.16.5/microsoft.identity.client.extensions.msal.2.16.5.nupkg.sha512",
15 | "/home/codespace/.nuget/packages/microsoft.identitymodel.jsonwebtokens/6.8.0/microsoft.identitymodel.jsonwebtokens.6.8.0.nupkg.sha512",
16 | "/home/codespace/.nuget/packages/microsoft.identitymodel.logging/6.8.0/microsoft.identitymodel.logging.6.8.0.nupkg.sha512",
17 | "/home/codespace/.nuget/packages/microsoft.identitymodel.protocols/6.8.0/microsoft.identitymodel.protocols.6.8.0.nupkg.sha512",
18 | "/home/codespace/.nuget/packages/microsoft.identitymodel.protocols.openidconnect/6.8.0/microsoft.identitymodel.protocols.openidconnect.6.8.0.nupkg.sha512",
19 | "/home/codespace/.nuget/packages/microsoft.identitymodel.tokens/6.8.0/microsoft.identitymodel.tokens.6.8.0.nupkg.sha512",
20 | "/home/codespace/.nuget/packages/microsoft.netcore.platforms/3.1.0/microsoft.netcore.platforms.3.1.0.nupkg.sha512",
21 | "/home/codespace/.nuget/packages/microsoft.win32.registry/4.7.0/microsoft.win32.registry.4.7.0.nupkg.sha512",
22 | "/home/codespace/.nuget/packages/microsoft.win32.systemevents/4.7.0/microsoft.win32.systemevents.4.7.0.nupkg.sha512",
23 | "/home/codespace/.nuget/packages/system.buffers/4.5.0/system.buffers.4.5.0.nupkg.sha512",
24 | "/home/codespace/.nuget/packages/system.configuration.configurationmanager/4.7.0/system.configuration.configurationmanager.4.7.0.nupkg.sha512",
25 | "/home/codespace/.nuget/packages/system.diagnostics.diagnosticsource/4.7.0/system.diagnostics.diagnosticsource.4.7.0.nupkg.sha512",
26 | "/home/codespace/.nuget/packages/system.drawing.common/4.7.0/system.drawing.common.4.7.0.nupkg.sha512",
27 | "/home/codespace/.nuget/packages/system.identitymodel.tokens.jwt/6.8.0/system.identitymodel.tokens.jwt.6.8.0.nupkg.sha512",
28 | "/home/codespace/.nuget/packages/system.memory/4.5.3/system.memory.4.5.3.nupkg.sha512",
29 | "/home/codespace/.nuget/packages/system.numerics.vectors/4.5.0/system.numerics.vectors.4.5.0.nupkg.sha512",
30 | "/home/codespace/.nuget/packages/system.runtime.caching/4.7.0/system.runtime.caching.4.7.0.nupkg.sha512",
31 | "/home/codespace/.nuget/packages/system.security.accesscontrol/4.7.0/system.security.accesscontrol.4.7.0.nupkg.sha512",
32 | "/home/codespace/.nuget/packages/system.security.cryptography.cng/4.5.0/system.security.cryptography.cng.4.5.0.nupkg.sha512",
33 | "/home/codespace/.nuget/packages/system.security.cryptography.protecteddata/4.7.0/system.security.cryptography.protecteddata.4.7.0.nupkg.sha512",
34 | "/home/codespace/.nuget/packages/system.security.permissions/4.7.0/system.security.permissions.4.7.0.nupkg.sha512",
35 | "/home/codespace/.nuget/packages/system.security.principal.windows/4.7.0/system.security.principal.windows.4.7.0.nupkg.sha512",
36 | "/home/codespace/.nuget/packages/system.text.encoding.codepages/4.7.0/system.text.encoding.codepages.4.7.0.nupkg.sha512",
37 | "/home/codespace/.nuget/packages/system.text.encodings.web/4.7.2/system.text.encodings.web.4.7.2.nupkg.sha512",
38 | "/home/codespace/.nuget/packages/system.text.json/4.6.0/system.text.json.4.6.0.nupkg.sha512",
39 | "/home/codespace/.nuget/packages/system.threading.tasks.extensions/4.5.2/system.threading.tasks.extensions.4.5.2.nupkg.sha512",
40 | "/home/codespace/.nuget/packages/system.windows.extensions/4.7.0/system.windows.extensions.4.7.0.nupkg.sha512"
41 | ],
42 | "logs": []
43 | }
--------------------------------------------------------------------------------
/test/dotnet/test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd $(dirname "$0")
3 |
4 | source test-utils.sh vscode
5 |
6 | # Remote - Containers does not auto-sync UID/GID for Docker Compose,
7 | # so make sure test project prvs match the non-root user in the container.
8 | fixTestProjectFolderPrivs
9 |
10 | # Run common tests
11 | checkCommon
12 |
13 | # template specific tests
14 | checkExtension "ms-dotnettools.csharp"
15 | checkExtension "ms-mssql.mssql"
16 | check "dotnet" dotnet --info
17 | check "nuget" dotnet restore
18 | check "msbuild" dotnet msbuild
19 | rm -rf ./obj ./bin
20 | rm -rf /workspaces/azuresql-devcontainers/azuresql-devcontainers.sln
21 | check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
22 | check "nvm-node" bash -c ". /usr/local/share/nvm/nvm.sh && node --version"
23 | check "yarn" bash -c ". /usr/local/share/nvm/nvm.sh && yarn --version"
24 |
25 | # Report result
26 | reportResults
27 |
28 |
--------------------------------------------------------------------------------
/test/javascript-node/.env:
--------------------------------------------------------------------------------
1 | DB_SERVER=localhost
2 | DB_USER=sa
3 | DB_PASSWORD=P@ssw0rd!
4 | DB_DATABASE=library
--------------------------------------------------------------------------------
/test/javascript-node/eslint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "rules": {
3 | "no-console": 0,
4 | "eqeqeq":"warn",
5 | "no-cond-assign": 0,
6 | "no-unused-vars": 1,
7 | "no-extra-semi": "warn",
8 | "semi": "warn"
9 | }
10 | };
--------------------------------------------------------------------------------
/test/javascript-node/index.js:
--------------------------------------------------------------------------------
1 | // This is a simple Express server that queries a SQL Server database and returns the results as JSON.
2 | // curl http://localhost:3000/books
3 | // curl http://localhost:3000/authors
4 |
5 | require('dotenv').config();
6 | const sql = require('mssql');
7 | const express = require('express');
8 | const app = express();
9 |
10 | const config = {
11 | user: process.env.DB_USER,
12 | password: process.env.DB_PASSWORD,
13 | server: process.env.DB_SERVER,
14 | database: process.env.DB_DATABASE,
15 | options: {
16 | encrypt: false, // If you're on Windows Azure, set this to true
17 | enableArithAbort: true
18 | }
19 | };
20 |
21 | const connectAndQuery = async () => {
22 | try {
23 | await sql.connect(config);
24 | const result = await sql.query`SELECT * FROM dbo.books`;
25 | console.log(result);
26 | } catch (err) {
27 | console.error(err);
28 | }
29 | };
30 |
31 | app.get('/books', async (req, res) => {
32 | try {
33 | await sql.connect(config);
34 | const result = await sql.query`SELECT * FROM dbo.books`;
35 | res.json(result.recordset);
36 | } catch (err) {
37 | console.error(err);
38 | res.status(500).send('An error occurred');
39 | }
40 | });
41 |
42 | app.get('/authors', async (req, res) => {
43 | try {
44 | await sql.connect(config);
45 | const result = await sql.query`SELECT * FROM dbo.authors`;
46 | res.json(result.recordset);
47 | } catch (err) {
48 | console.error(err);
49 | res.status(500).send('An error occurred');
50 | }
51 | });
52 |
53 | const PORT = process.env.PORT || 3000;
54 | app.listen(PORT, () => {
55 | console.log(`Server is running on port ${PORT}`);
56 | connectAndQuery();
57 |
58 | // Used for automated testing
59 | if(process.env.REGRESSION_TESTING === 'true') { process.exit(0); }
60 | });
61 |
--------------------------------------------------------------------------------
/test/javascript-node/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "start": "node index.js",
7 | "test": " REGRESSION_TESTING=true npm start"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "description": "Simple test to check database connectivity",
13 | "dependencies": {
14 | "dotenv": "^16.3.1",
15 | "express": "^4.18.2",
16 | "mssql": "^10.0.2"
17 | }
18 | }
--------------------------------------------------------------------------------
/test/javascript-node/test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd $(dirname "$0")
3 |
4 | source test-utils.sh node
5 |
6 | # Remote - Containers does not auto-sync UID/GID for Docker Compose,
7 | # so make sure test project prvs match the non-root user in the container.
8 | fixTestProjectFolderPrivs
9 |
10 | # Run common tests
11 | checkCommon
12 |
13 | # template specific tests
14 | checkExtension "dbaeumer.vscode-eslint"
15 | check "node" node --version
16 | sudo rm -f yarn.lock
17 | check "yarn" yarn install
18 | sudo rm -f package-lock.json
19 | check "npm" npm install
20 | check "eslint" eslint index.js
21 | check "test-project" npm run test
22 | npm config delete prefix
23 | check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 8"
24 | check "nvm-node" bash -c ". /usr/local/share/nvm/nvm.sh && node --version"
25 | sudo rm -rf node_modules
26 |
27 | # Report result
28 | reportResults
--------------------------------------------------------------------------------
/test/python/requirements.txt:
--------------------------------------------------------------------------------
1 | pyodbc
--------------------------------------------------------------------------------
/test/python/test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd $(dirname "$0")
3 |
4 | source test-utils.sh vscode
5 |
6 | # Run common tests
7 | checkCommon
8 |
9 | # template specific tests
10 | checkExtension "ms-python.python"
11 | checkExtension "ms-python.vscode-pylance"
12 | check "python" python --version
13 | check "pip install" pip install -r requirements.txt
14 | check "test-project: test_sql_connection.py" python ./test_sql_connection.py
15 |
16 | # Report
17 | reportResults
--------------------------------------------------------------------------------
/test/python/test_sql_connection.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import pyodbc
3 |
4 | # python3 -m venv venv
5 | # source venv/bin/activate
6 | # pip install -r requirements.txt
7 |
8 | server = 'localhost' # Replace with your server name or IP address
9 | database = 'library' # Replace with your database name
10 | username = 'sa' # Replace with your username
11 | password = 'P@ssw0rd!' # Replace with your password
12 | driver = '{ODBC Driver 17 for SQL Server}'
13 |
14 | try:
15 | connection_string = f'DRIVER={driver};SERVER={server};PORT=1433;DATABASE={database};UID={username};PWD={password}'
16 | conn = pyodbc.connect(connection_string)
17 | cursor = conn.cursor()
18 | cursor.execute('SELECT @@VERSION')
19 | row = cursor.fetchone()
20 | print('Connected to SQL Server')
21 | print('SQL Server Version:', row[0])
22 | except Exception as e:
23 | print('Error:', e)
24 | finally:
25 | if conn:
26 | conn.close()
--------------------------------------------------------------------------------
/test/test-utils/test-utils.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | USERNAME=${1:-vscode}
3 |
4 | if [ -z $HOME ]; then
5 | HOME="/root"
6 | fi
7 |
8 | FAILED=()
9 |
10 | echoStderr()
11 | {
12 | echo "$@" 1>&2
13 | }
14 |
15 | check() {
16 | LABEL=$1
17 | shift
18 | echo -e "\n🧪 Testing $LABEL"
19 | if "$@"; then
20 | echo "✅ Passed!"
21 | return 0
22 | else
23 | echoStderr "❌ $LABEL check failed."
24 | FAILED+=("$LABEL")
25 | return 1
26 | fi
27 | }
28 |
29 | checkMultiple() {
30 | PASSED=0
31 | LABEL="$1"
32 | echo -e "\n🧪 Testing $LABEL."
33 | shift; MINIMUMPASSED=$1
34 | shift; EXPRESSION="$1"
35 | while [ "$EXPRESSION" != "" ]; do
36 | if $EXPRESSION; then ((PASSED++)); fi
37 | shift; EXPRESSION=$1
38 | done
39 | if [ $PASSED -ge $MINIMUMPASSED ]; then
40 | echo "✅ Passed!"
41 | return 0
42 | else
43 | echoStderr "❌ $LABEL check failed."
44 | FAILED+=("$LABEL")
45 | return 1
46 | fi
47 | }
48 |
49 | checkOSPackages() {
50 | LABEL=$1
51 | shift
52 | echo -e "\n🧪 Testing $LABEL"
53 | if dpkg-query --show -f='${Package}: ${Version}\n' "$@"; then
54 | echo "✅ Passed!"
55 | return 0
56 | else
57 | echoStderr "❌ $LABEL check failed."
58 | FAILED+=("$LABEL")
59 | return 1
60 | fi
61 | }
62 |
63 | checkCommon()
64 | {
65 | PACKAGE_LIST="apt-utils \
66 | git \
67 | openssh-client \
68 | less \
69 | iproute2 \
70 | procps \
71 | curl \
72 | wget \
73 | unzip \
74 | nano \
75 | jq \
76 | lsb-release \
77 | ca-certificates \
78 | apt-transport-https \
79 | dialog \
80 | gnupg2 \
81 | libc6 \
82 | libgcc1 \
83 | libgssapi-krb5-2 \
84 | liblttng-ust[0-1] \
85 | libstdc++6 \
86 | zlib1g \
87 | locales \
88 | sudo"
89 |
90 | # Actual tests
91 | checkOSPackages "common-os-packages" ${PACKAGE_LIST}
92 | # checkMultiple "vscode-server" 1 "[ -d $HOME/.vscode-server/bin ]" "[ -d $HOME/.vscode-server-insiders/bin ]" "[ -d $HOME/.vscode-test-server/bin ]" "[ -d $HOME/.vscode-remote/bin ]" "[ -d $HOME/.vscode-remote/bin ]"
93 | check "non-root-user" id ${USERNAME}
94 | check "locale" [ $(locale -a | grep en_US.utf8) ]
95 | check "sudo" sudo echo "sudo works."
96 | check "zsh" zsh --version
97 | check "oh-my-zsh" [ -d "$HOME/.oh-my-zsh" ]
98 | check "login-shell-path" [ -f "/etc/profile.d/00-restore-env.sh" ]
99 | check "code" which code
100 | }
101 |
102 | reportResults() {
103 | if [ ${#FAILED[@]} -ne 0 ]; then
104 | echoStderr -e "\n💥 Failed tests: ${FAILED[@]}"
105 | exit 1
106 | else
107 | echo -e "\n💯 All passed!"
108 | exit 0
109 | fi
110 | }
111 |
112 | # Useful for scenarios where UID/GID is not automatically updated - happens in GitHub Actions w/Docker Compose
113 | fixTestProjectFolderPrivs() {
114 | if [ "${USERNAME}" != "root" ]; then
115 | TEST_PROJECT_FOLDER="${1:-$SCRIPT_FOLDER}"
116 | FOLDER_USER="$(stat -c '%U' "${TEST_PROJECT_FOLDER}")"
117 | if [ "${FOLDER_USER}" != "${USERNAME}" ]; then
118 | echoStderr "WARNING: Test project folder is owned by ${FOLDER_USER}. Updating to ${USERNAME}."
119 | sudo chown -R ${USERNAME} "${TEST_PROJECT_FOLDER}"
120 | fi
121 | fi
122 | }
123 |
124 | checkExtension() {
125 | # Happens asynchronusly, so keep retrying 10 times with an increasing delay
126 | EXTN_ID="$1"
127 | TIMEOUT_SECONDS="${2:-10}"
128 | RETRY_COUNT=0
129 | echo -e -n "\n🧪 Looking for extension $1 for maximum of ${TIMEOUT_SECONDS}s"
130 | until [ "${RETRY_COUNT}" -eq "${TIMEOUT_SECONDS}" ] || \
131 | [ ! -e $HOME/.vscode-server/extensions/${EXTN_ID}* ] || \
132 | [ ! -e $HOME/.vscode-server-insiders/extensions/${EXTN_ID}* ] || \
133 | [ ! -e $HOME/.vscode-test-server/extensions/${EXTN_ID}* ] || \
134 | [ ! -e $HOME/.vscode-remote/extensions/${EXTN_ID}* ]
135 | do
136 | sleep 1s
137 | (( RETRY_COUNT++ ))
138 | echo -n "."
139 | done
140 |
141 | if [ ${RETRY_COUNT} -lt ${TIMEOUT_SECONDS} ]; then
142 | echo -e "\n✅ Passed!"
143 | return 0
144 | else
145 | echoStderr -e "\n❌ Extension $EXTN_ID not found."
146 | FAILED+=("$LABEL")
147 | return 1
148 | fi
149 | }
150 |
--------------------------------------------------------------------------------
/test/test-utils/tests-by-template.sh:
--------------------------------------------------------------------------------
1 | # Smoke tests
2 | # .NET
3 | cd /workspaces/azuresql-devcontainers
4 | ./.github/actions/smoke-test/build-dotnet.sh dotnet
5 | ./.github/actions/smoke-test/test-dotnet.sh dotnet
6 |
7 | # .NET Aspire
8 | ./.github/actions/smoke-test/build-dotnet-aspire.sh dotnet-aspire
9 | ./.github/actions/smoke-test/test-dotnet-aspire.sh dotnet-aspire
10 |
11 | # Node.js
12 | ./.github/actions/smoke-test/build-javascript-node.sh javascript-node
13 | ./.github/actions/smoke-test/test-javascript-node.sh javascript-node
14 |
15 | # Python
16 | ./.github/actions/smoke-test/build-python.sh python
17 | ./.github/actions/smoke-test/test-python.sh python
18 |
19 | # Remove all containers
20 | docker rm -f $(docker ps -a -q)
21 |
22 | # Remove all unused Docker objects...
23 | docker system prune -a -f
--------------------------------------------------------------------------------
/test/test-utils/troubleshooting.sh:
--------------------------------------------------------------------------------
1 | # Create SQL Library container (manually)
2 | docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=P@ssw0rd!' \
3 | --memory=2048m --cpus=1 --hostname SQL-Library --name SQL-Library \
4 | --restart unless-stopped -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest
5 |
6 | # Deploy Library database (manually)
7 | sqlcmd -S localhost -U sa -P P@ssw0rd! \
8 | -d master -i test/test-utils/Library.sql \
9 | -v DatabaseName="Library" DefaultFilePrefix="Library" \
10 | DefaultDataPath="/var/opt/mssql/data/" DefaultLogPath="/var/opt/mssql/data/" __IsSqlCmdEnabled="True"
--------------------------------------------------------------------------------