Skip to content

Commit 5c67da0

Browse files
jurjenoskamJurjen Oskamddoyle2017
authored
[azure-cli]: add bicepVersion for use with installBicep (#1227)
Add `bicepVersion` parameter (defaulting to `latest`) to optionally specify a specific Bicep version when `installBicep` is `true`. Co-authored-by: Jurjen Oskam <[email protected]> Co-authored-by: Daniel Doyle <[email protected]>
1 parent c31723d commit 5c67da0

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/azure-cli/devcontainer-feature.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "azure-cli",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"name": "Azure CLI",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/azure-cli",
66
"description": "Installs the Azure CLI along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",
@@ -23,6 +23,14 @@
2323
"description": "Optionally install Azure Bicep",
2424
"default": false
2525
},
26+
"bicepVersion": {
27+
"type": "string",
28+
"proposals": [
29+
"latest"
30+
],
31+
"default": "latest",
32+
"description": "Select or enter a Bicep version. ('latest' or a specic version such as 'v0.31.92')"
33+
},
2634
"installUsingPython": {
2735
"type": "boolean",
2836
"description": "Install Azure CLI using Python instead of pipx",

src/azure-cli/install.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ rm -rf /var/lib/apt/lists/*
1515
AZ_VERSION=${VERSION:-"latest"}
1616
AZ_EXTENSIONS=${EXTENSIONS}
1717
AZ_INSTALLBICEP=${INSTALLBICEP:-false}
18+
AZ_BICEPVERSION=${BICEPVERSION:-latest}
1819
INSTALL_USING_PYTHON=${INSTALLUSINGPYTHON:-false}
1920
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
2021
AZCLI_ARCHIVE_ARCHITECTURES="amd64 arm64"
@@ -229,10 +230,16 @@ if [ "${AZ_INSTALLBICEP}" = "true" ]; then
229230
# The `az bicep install --target-platform` could be a solution; however, linux-arm64 is not an allowed value for this argument yet
230231
# Manually installing Bicep and moving to the appropriate directory where az expects it to be
231232

233+
if [ "${AZ_BICEPVERSION}" = "latest" ]; then
234+
bicep_download_path="https://github.com/Azure/bicep/releases/latest/download"
235+
else
236+
bicep_download_path="https://github.com/Azure/bicep/releases/download/${AZ_BICEPVERSION}"
237+
fi
238+
232239
if [ "${architecture}" = "arm64" ]; then
233-
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-arm64
240+
curl -Lo bicep ${bicep_download_path}/bicep-linux-arm64
234241
else
235-
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64
242+
curl -Lo bicep ${bicep_download_path}/bicep-linux-x64
236243
fi
237244

238245
chmod +x ./bicep

0 commit comments

Comments
 (0)