Solution skill
AZ CLI 2.71.x breaks bicep deployments when using Azure Devops Agent
Complete solution
Shows how to fix aZ CLI 2.71.x breaks bicep deployments when using Azure Devops Agent. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
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.
Steps
- 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
- 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.
When to use
Use this skill when you run into "AZ CLI 2.71.x breaks bicep deployments when using Azure Devops Agent".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: CLI 2.72.0. If you are on something much newer or older, the details may have shifted.
Why this happens
This works because it runs AZ CLI 2.70 ```yaml - task: AzureCLI@2 inputs: azureSubscription: ${{ parameters.serviceConnection }} scriptType: pscore scriptLocation: in
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 2 · 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>