5

When trying to run terraform locally with azurerm provider on my machine, I receive this error :

Error: Error building account: Error getting authenticated object ID: Error parsing json result from the Azure CLI: Error waiting for the Azure CLI: exit status 1

I followed this link : https://github.com/terraform-providers/terraform-provider-azurerm/issues/3686#issuecomment-523983734

but the az account get-access-token works.

Any ideas?

4

3 回答 3

9

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!

于 2020-03-24T20:10:18.777 回答
0

我有这个,但az ad signed-in-user show工作正常,Azure CLI 是最新的。

Terraform 在后台使用命令行,但我的终端在开始时注入了额外的行(版本控制、别名/doskey),这是 terraform 抱怨的地方,而不是 Azure CLI。所以我把它关掉了,它开始工作了。

于 2021-09-30T15:22:25.413 回答
-1

az login再次运行,它对我有用!

于 2021-05-18T07:53:16.983 回答