azureazure-devopsazure-cliazure-bicep

No such file or directory: '/home/vsts/work/_temp/.azclitask/bin/bicep' when doing az deployment mg in an Azure DevOps pipeline


When running the following commands in a Shell script called by the AzureCLI@2 task of an Azure DevOps pipeline:

az bicep install
az deployment mg what-if --name ${NAME:0:63} --location $LOCATION --template-file $TEMPLATEFILE --parameters $PARAMETERS --management-group-id $MGID

I have the following error:

ERROR: [Errno 2] No such file or directory: '/home/vsts/work/_temp/.azclitask/bin/bicep'

The az bicep install command ran successfully. Does anybody know what could be wrong?


Solution

  • It’s a bug with latest Azure CLI (2.71) It’s also broken with Github pipelines

    _binary_from_path by itself didn’t work for me. This did:

    az bicep uninstall
    az config set bicep.use_binary_from_path=false
    az bicep install
    

    Source:

    https://github.com/Azure/azure-cli/issues/31189#issuecomment-2790370116