Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az deployment in bicep fails since version 2.68 release #30654

Open
Benoit-Gaumard opened this issue Jan 14, 2025 · 5 comments
Open

az deployment in bicep fails since version 2.68 release #30654

Benoit-Gaumard opened this issue Jan 14, 2025 · 5 comments
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot Azure Deployments az deployment/bicep/stack/deployment-scripts/ts/group export bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.

Comments

@Benoit-Gaumard
Copy link

Describe the bug

Since the 2.68 release, all my GitHub Actions pipelines are failling

AZ_VER=2.68.0
sudo apt-get update && sudo apt-get install -y azure-cli=${AZ_VER}-1~${AZ_DIST}

I don't know if it is related to Azure/cli@v2 action or az cli 2.68 release itself

More infos below ...

Related command

The last job (Bicep Validate) failed every time:

 # Step 2: Install Azure CLI
  - name: Install Azure CLI
    run: |
      sudo apt-get update
      sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release libicu-dev -y
      mkdir -p /etc/apt/keyrings
      curl -sL https://packages.microsoft.com/keys/microsoft.asc |
        gpg --dearmor |
            sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
      SUITE=$(lsb_release -cs)
      echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ $SUITE main" |
          sudo tee /etc/apt/sources.list.d/microsoft.list
      cat << EOF | sudo tee /etc/apt/preferences.d/99-microsoft
      Package: *
      Pin: origin https://packages.microsoft.com/repos/azure-cli
      Pin-Priority: 1
      Package: azure-cli
      Pin: origin https://packages.microsoft.com/repos/azure-cli
      Pin-Priority: 500
      EOF
      AZ_DIST=$(lsb_release -cs)
      AZ_VER=2.68.0          
      sudo apt-get update && sudo apt-get install -y azure-cli=${AZ_VER}-1~${AZ_DIST}

  # Step 3: Install Bicep CLI
  - name: Install Bicep
    run: |
      az bicep install
      az bicep upgrade  # Ensure latest version
  # Authenticate to Azure CLI using OIDC (managed identity Federated credentials)
  - name: Authenticate to Azure
    uses: azure/login@v1
    with:
      client-id: ${{ secrets.AZURE_CLIENT_ID }}
      subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
      tenant-id: ${{ secrets.AZURE_TENANT_ID }}

  # Validate whether a template is valid at subscription scope
  - name: Bicep Validate - Group
    if: inputs.scope == 'group'
    uses: Azure/cli@v2
    with:
      inlineScript: |
        export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
        az deployment group validate \
          --template-file ${{ inputs.template-path }} \
          --parameters '${{ inputs.parameter }}' \
          --resource-group ${{ inputs.resource-group }}

Errors

Here is the GitHub Actions run output:

Run Azure/cli@v2
with:
inlineScript: export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
az deployment sub validate
--template-file bicep/00-main.bicep
--parameters '{}'
--location 'northeurope'

azcliversion: agentazcliversion

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.
Warning: Error: EISDIR: illegal operation on a directory, unlink '/home/runner/_work/_temp'
cleaning up container...
Warning: Error response from daemon: No such container: MICROSOFT_AZURE_CLI_1736852898359_CONTAINER

Issue script & Debug output

It works if replacing version to the oldest version: 2.67

AZ_VER=2.67.0
sudo apt-get update && sudo apt-get install -y azure-cli=${AZ_VER}-1~${AZ_DIST}

Expected behavior

Bicep Validate Job

Run Azure/cli@v2
with:
inlineScript: export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
az deployment sub validate
--template-file bicep/00-main.bicep
--parameters '{}'
--location 'northeurope'

azcliversion: agentazcliversion

Starting script execution via docker image mcr.microsoft.com/azure-cli:2.67.0
az script ran successfully.
cleaning up container...
MICROSOFT_AZURE_CLI_1736856936920_CONTAINER

Environment Summary

az cli 2.68

Additional context

No response

@Benoit-Gaumard Benoit-Gaumard added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jan 14, 2025
Copy link

Hi @Benoit-Gaumard,

2.67.0 is not the latest Azure CLI(2.68.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@azure-client-tools-bot-prd azure-client-tools-bot-prd bot added the Auto-Resolve Auto resolve by bot label Jan 14, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Azure Deployments az deployment/bicep/stack/deployment-scripts/ts/group export Service Attention This issue is responsible by Azure service team. labels Jan 14, 2025
@Benoit-Gaumard
Copy link
Author

Hello Mister bot,

Upgrading to AZ CLI 2.68.0 is causing breaking changes :)

@jeffpppoint
Copy link

2.68.0 isn't listed on https://mcr.microsoft.com/v2/azure-cli/tags/list so this step is failing. I'm having the same issue on github using azure/cli tasks

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 14, 2025

route to service team

@bebound
Copy link
Contributor

bebound commented Jan 15, 2025

Previously, there was an issue with MAR where version 2.68.0 was unavailable.

It has been fixed. Let me know if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot Azure Deployments az deployment/bicep/stack/deployment-scripts/ts/group export bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

4 participants