terraform azurerm : Error waiting for the Azure CLI: exit status 1

Viewed 12719
3 Answers

Since my organization is using a self-signed certificate to control internet traffic, the az cli is not working as usual. To diagnose, you should run this command :

az ad signed-in-user show

It will show you a very clear message to workaround this issue.

https://github.com/Azure/azure-cli/blob/dev/doc/use_cli_effectively.md#working-behind-a-proxy

I exported the CA certificate from any website from Chrome in Base64 and copied the string in the pem file as indicated in the previous link. It worked!

On Windows : Append the certificate in C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\certifi\cacert.pem

Hope this helps someone!

Run az login again, it's worked for me!

I had this but the az ad signed-in-user show worked and the Azure CLI was up-to-date.

Terraform uses the command-line under-the-hood, but my terminal had additional lines injected in at the start (versioning, aliases/doskey), which is the bit that terraform was complaining about, rather than the Azure CLI. So I turned that off and it started working.

Related