Immutable solution version
AZ CLI 2.71.x breaks bicep deployments when using Azure Devops Agent
Complete solution
Teaches how to aZ CLI 2.71.x breaks bicep deployments when using Azure Devops Agent. Based on a real issue report and its verified fix.
The problem
Issue Azure/azure-cli#31189 (closed, 64 comments): ### Describe the bug When performing a bicep operation using the az cli in an Azure Devops Pipeline that has been upgraded to AZ CLI 2.71.x we seem to run in to the following: FileNotFoundError: [Errno 2] No such file or directory: '[HOME]/...' This is a problem on: - Ubuntu 22.04 Self Hosted - Ubuntu 24.04 Self Hosted - Ubuntu 22.04 Microsoft Hosted Azure Pipelines - Ubuntu-22.04 pool. This works because it runs AZ CLI 2.70 ```yaml - task: AzureCLI@2 inputs: azureSubscription: ${{ parameters.serviceConnection }} scriptType: pscore scriptLocation: in
What to do
AZ CLI 2.71.x breaking Bicep deployments on Azure DevOps agents: a regression fixed in Azure CLI 2.72.0, which the Microsoft-hosted agents now include. Upgrade to 2.72.0+. If you are stuck on older agents, install the Azure CLI edge build as a pipeline step.
Evidence
In the GitHub issue gh:Azure/azure-cli#31189 (https://github.com/Azure/azure-cli/issues/31189), the problem reported was: Issue Azure/azure-cli#31189 (closed, 64 comments): ### Describe the bug When performing a bicep operation using the az cli in an Azure Devops Pipeline that has been upgraded to AZ CLI 2.71.x we seem to run in to the following: FileNotFoundError: [Errno 2] No such file or directory: '[HOME]/...' This is a problem on: - Ubuntu 22.04 Self Hosted - Ubuntu 24.04 Self Hosted - Ubuntu 22.04 Microsoft Hosted Azure Pipelines - Ubuntu-22.04 pool. This works because it runs AZ CLI 2.70 ```yaml - task: AzureCLI@2 inputs: azureSubscription: ${{ parameters.serviceConnection }} scriptType: pscore scriptLocation: in The verified resolution was: AZ CLI 2.71.x breaking Bicep deployments on Azure DevOps agents: a regression fixed in Azure CLI 2.72.0, which the Microsoft-hosted agents now include. Upgrade to 2.72.0+. If you are stuck on older agents, install the Azure CLI edge build as a pipeline step.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_GaJ0ZhxLvDso4H8Gs-QyGg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">AZ CLI 2.71.x breaks bicep deployments when using Azure Devops Agent <span>— Vectle</span></a>