diff --git a/images/linux/scripts/installers/azure-cli.sh b/images/linux/scripts/installers/azure-cli.sh index 713d23151..af6e41963 100644 --- a/images/linux/scripts/installers/azure-cli.sh +++ b/images/linux/scripts/installers/azure-cli.sh @@ -6,9 +6,16 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh +source $HELPER_SCRIPTS/os.sh # Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash +# Temporary downgrade to 2.5.1 installation until version 2.7.0 with the fix for the issue is not released https://github.com/actions/virtual-environments/issues/948 +# There is no 2.5.1 version for Ubuntu20 +if isUbuntu16 || isUbuntu18 ; then + label=$(getOSVersionLabel) + apt-get install -y --allow-downgrades azure-cli=2.5.1-1~$label +fi # Run tests to determine that the software installed as expected echo "Testing to make sure that script performed as expected, and basic scenarios work" diff --git a/images/win/scripts/Installers/Install-AzureCli.ps1 b/images/win/scripts/Installers/Install-AzureCli.ps1 index 4b5d7dae1..c5432bc6b 100644 --- a/images/win/scripts/Installers/Install-AzureCli.ps1 +++ b/images/win/scripts/Installers/Install-AzureCli.ps1 @@ -3,7 +3,8 @@ ## Desc: Install Azure CLI ################################################################################ -Choco-Install -PackageName azure-cli +# Temporary hardcode 2.5.1 installation until version 2.7.0 with the fix for the issue is not released https://github.com/actions/virtual-environments/issues/948 +Choco-Install -PackageName azure-cli -ArgumentList "--version=2.5.1" $AzureCliExtensionPath = Join-Path $Env:CommonProgramFiles 'AzureCliExtensionDirectory' New-Item -ItemType "directory" -Path $AzureCliExtensionPath