ERROR: Please run ‘az login’ to setup account

Hello Team,

I’m getting the below error while creating resources in Azure using terraform with Jenkins Pipeline

Error building ARM Config: obtain subscription() from Azure CLI: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: ERROR: Please run 'az login' to setup account.

The Azure_Credentials variable under Jenkins credentials shows me as successfully verified.

I’m able to run Terraform Init and Plan locally on RHEL 9 Box.

Kindly Help,


Hi Rahul,

not sure that I will be of any help but I add the same problem here and solved it by using the same agent for the sh steps :

(for us the updatecli process was dealt with by a shared library that was spawning a new agent … so the az login was kind of lost)

Good luck,

1 Like