Azure / cli

Automate your GitHub workflows using Azure CLI scripts
MIT License
133 stars 54 forks source link

GitHub Action fails with "Please enter a valid azure cli version" error message with default "azcliversion" parameter #158

Closed fabasoad closed 3 months ago

fabasoad commented 3 months ago

Steps to reproduce

  1. Use these steps in your GitHub Action:
- name: Install Azure CLI
  run: |
    curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
  shell: bash
- name: Azure CLI script
  uses: Azure/cli@v2
  with:
    inlineScript: |
      az version

Expected behavior

Azure/cli@v2 should work without any errors.

Actual behavior

The following error message is shown:

Error: Please enter a valid azure cli version. 
See available versions: https://github.com/Azure/azure-cli/releases.
Error: Error: Please enter a valid azure cli version. 
See available versions: https://github.com/Azure/azure-cli/releases.

Version info

az version
{
  "azure-cli": "2.63.0",
  "azure-cli-core": "2.63.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {}
}

Additional notes

I think the problem is that 2.63.0 version is missing in the list of tags which is used to determine if version is valid or not. I've checked with azcliversion: 2.62.0 and it works as expected but the installed version of az CLI is 2.63.0 which is taken by that script.

Recommendations

Add 2.63.0 to the list of tags in https://mcr.microsoft.com/v2/azure-cli/tags/list

MoChilia commented 3 months ago

Hi @fabasoad, the azure-cli: 2.63.0 image will be released soon, see https://github.com/Azure/azure-cli/pull/29628. For now, please set azcliversion to 2.62.0 as a temporary workaround. Apologies for the inconvenience.

fabasoad commented 3 months ago

@MoChilia Thanks for quick reply! Would it be OK that installed az CLI is 2.63.0 but Azure/cli@v2 action will use image with 2.62.0 version?

MoChilia commented 3 months ago

@fabasoad, I think it's ok to do that because Azure/cli runs in a separate Docker container environment. I will inform you once 2.63.0 is available in Azure/cli.

MoChilia commented 3 months ago

@fabasoad, the azure-cli: 2.63.0 image has been released and is now available for use in Azure/cli.

cadwal commented 3 months ago

@MoChilia, for 2.64.0 should we expect the tag 2.64.0 (and at that time latest) to be an alias for 2.64.0-cbl-mariner2.0(-) and the images without the cbl-mariner2.0 prefix/infix to not exist?

I assume that today what is tag:ed cbl-mariner2.0 is actually latest-cbl-mariner2.0 etc. ?

Mm, when I look at it in more detail, today latest(-whatever) seems to be a separate image for each platform rather than just being a tag on the intended version? (For something like dotnet/runtime latest is currently just 8.0.7 not a separate image)

fabasoad commented 3 months ago

@MoChilia Confirmed. Works for me now 👍 Thank you.

MoChilia commented 3 months ago

Hi @cadwal, the latest tag now points to azure-cli:2.63.0 for Alpine Linux. Please note that this is the final version supported on Alpine. Microsoft will no longer provide updates or bug fixes for this image. For more details, https://go.microsoft.com/fwlink/?linkid=2282203. We are currently discussing which Linux distribution 2.64.0 will be based.