Indeed, an issue with AzureCLI@2. Thanks @Vandre, indeed the problem was to do with _binary_from_path
. 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_binary_from_path=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'