Question Details

No question body available.

Tags

azure azure-devops azure-cli azure-bicep

Answers (5)

Accepted Answer Available
Accepted Answer
April 11, 2025 Score: 3 Rep: 911 Quality: Medium Completeness: 60%

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

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

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

Source:

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

May 1, 2025 Score: 2 Rep: 46 Quality: Low Completeness: 60%

I am using AzureCLI@2 task in my Azure DevOps YAML pipeline and simply adding

az config set bicep.usebinaryfrom_path=false

in the first line of inlineScript section of the task resolved the issue. No bicep install/uninstall was required.
Thanks @vandre for the suggestion.

April 14, 2025 Score: 1 Rep: 1,729 Quality: Low Completeness: 80%

I do not think you need to install bicep in AzureCLI@2 Task additionally.

I have test using resource group level deployment, it do not have the essential difference with your case.

la.bicep

param location string = resourceGroup().location
param logAnalyticsWorkspaceName string = 'wbtest1017'

resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' = { name: logAnalyticsWorkspaceName location: location }

azure-pipelines.yml

pool:
  vmImage: 'windows-latest'

steps: - task: AzureCLI@2 displayName: Azure CLI inputs: azureSubscription: DevOpsSub1Connection-Test scriptType: ps scriptLocation: inlineScript inlineScript: |

az bicep version

az deployment group what-if --resource-group wb-test-once-rg --name wbtest --template-file '$(System.DefaultWorkingDirectory)\la.bicep'

enter image description here

May 12, 2025 Score: 0 Rep: 1 Quality: Low Completeness: 30%
May 12, 2025 Score: 0 Rep: 1 Quality: Low Completeness: 60%

Indeed, an issue with AzureCLI@2. Thanks @Vandre, indeed the problem was to do with binaryfrompath. You told the Azure CLI to stop trying to find and use a local bicep binary from the system path. Instead, it now falls back to the built-in Azure CLI-integrated Bicep transpiler, which is more stable and self-contained.

Pasting below full code snippet block if this helps anyone using AzureCLI@2. My environment is Azure Pipelines Starter.

- task: AzureCLI@2 inputs: azureSubscription: ${{ variables.serviceConnectionName }} workingDirectory: '$(Build.SourcesDirectory)/Bicep' scriptType: pscore scriptLocation: inlineScript inlineScript: | az config set bicep.use
binaryfrompath=false az account set --subscription ${{ variables.subscriptionid }} az deployment group create --name '${{ variables.deploymentName }}_$(Build.BuildId)' --mode Incremental --resource-group ${{ variables.resourceGroupName }} --template-file $(Build.SourcesDirectory)${{ variables.mainTemplateFileName }} --parameters $(Build.SourcesDirectory)${{ variables.mainParamFileName }} displayName: 'Deploy Main Bicep'