## 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

1. 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

2. 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
