Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ jobs:
- azure-functions-core-tools
- mssql-odbc-driver
baseImage:
- debian:11
- debian:12
- debian:latest
- ubuntu:22.04
- ubuntu:24.04
- ubuntu:latest
- mcr.microsoft.com/devcontainers/base:ubuntu
steps:
Expand Down
2 changes: 1 addition & 1 deletion src/azure-functions-core-tools/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "azure-functions-core-tools",
"version": "1.0.0",
"version": "1.0.1",
"name": "Azure Functions Core Tools",
"documentationURL": "https://github.com/jlaundry/devcontainer-features/tree/main/src/azure-functions-core-tools",
"description": "Installs the Azure Functions Core Tools along with needed dependencies. Useful for developing Azure Function apps inside codespaces.",
Expand Down
23 changes: 19 additions & 4 deletions src/azure-functions-core-tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@ rm -rf /var/lib/apt/lists/*

AZ_VERSION=${VERSION:-"latest"}

MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
OS_VERSION_ID="$(source /etc/os-release; echo "${ID}:${VERSION_ID}")"
case $OS_VERSION_ID in
debian:10) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
debian:11) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
debian:12) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
debian:13) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
ubuntu:20.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
ubuntu:22.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
ubuntu:24.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
ubuntu:26.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
*) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
esac

echo "using Microsoft GPG key ${MICROSOFT_GPG_KEYS_URI} for ${OS_VERSION_ID}"

if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
Expand Down Expand Up @@ -98,12 +111,14 @@ apt_cache_version_soft_match() {
}

install_using_apt() {
echo "installing azure-functions-core-tools with AZ_VERSION=${AZ_VERSION} using MICROSOFT_GPG_KEYS_URI=${MICROSOFT_GPG_KEYS_URI} on ${architecture}"

# Install dependencies
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr

# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
get_common_setting MICROSOFT_GPG_KEYS_URI
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/$ID/$VERSION_ID/prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-functions-core-tools.list
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-prod.gpg
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/$ID/$VERSION_ID/prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-functions-core-tools.list
apt-get update

if [ "${AZ_VERSION}" = "latest" ] || [ "${AZ_VERSION}" = "lts" ] || [ "${AZ_VERSION}" = "stable" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/mssql-odbc-driver/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "mssql-odbc-driver",
"version": "1.0.2",
"version": "1.0.3",
"name": "SQL Server ODBC Driver",
"documentationURL": "https://github.com/jlaundry/devcontainer-features/tree/main/src/mssql-odbc-driver",
"description": "Installs the Microsoft SQL Server ODBC Driver.",
Expand Down
26 changes: 20 additions & 6 deletions src/mssql-odbc-driver/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@ set -e
# Clean up
rm -rf /var/lib/apt/lists/*

ODBC_VERSION=${VERSION:-"latest"}

MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
ODBC_VERSION=${VERSION:-"18"}

OS_VERSION_ID="$(source /etc/os-release; echo "${ID}:${VERSION_ID}")"
case $OS_VERSION_ID in
debian:10) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
debian:11) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
debian:12) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
debian:13) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
ubuntu:20.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
ubuntu:22.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
ubuntu:24.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
ubuntu:26.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
*) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
esac

echo "using Microsoft GPG key ${MICROSOFT_GPG_KEYS_URI} for ${OS_VERSION_ID}"

if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
Expand Down Expand Up @@ -51,13 +64,14 @@ export DEBIAN_FRONTEND=noninteractive


install_using_apt() {
echo "installing msodbcsql withODBC_VERSION=${ODBC_VERSION} using MICROSOFT_GPG_KEYS_URI=${MICROSOFT_GPG_KEYS_URI} on ${architecture}"
# Install dependencies
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr

# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
get_common_setting MICROSOFT_GPG_KEYS_URI
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-prod.gpg

echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/$ID/$VERSION_ID/prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/mssql-release.list
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/$ID/$VERSION_ID/prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/mssql-release.list
apt-get update

if [ $ODBC_VERSION -eq "18" ]; then
Expand Down
Loading