question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Error building AzureRM Client: Azure CLI Authorization Profile was not found. Please ensure the Azure CLI is installed and then log-in with `az login`.

See original GitHub issue

I am getting the bellow error when running terraform plan. Did anyone face the same issue ? I am able to login using az login as well.

Error: Error building AzureRM Client: Azure CLI Authorization Profile was not found. Please ensure the Azure CLI is installed and then log-in with `az login`.

  on main.tf line 1, in provider "azurerm":
   1: provider "azurerm" {``

I am using WSL**, and I have installed azure cli from MS docs. Bellow is my az -version for reference.

az --version azure-cli 2.6.0 *

command-modules-nspkg 2.0.3 core 2.6.0 * nspkg 3.0.4 telemetry 1.0.4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nocticdrcommented, Oct 9, 2020

Had the same issue, however it was happening at terraform init stage and deleting the .azure folder didn’t help. What was happening on my end was that although I was able to do az login in WSL, the .azure folder was being saved under the Windows user path instead. What worked for me was to copy the .azure folder in Windows to my WSL user directory and terraform init worked again. Thanks @magodo for the pointer

0reactions
jiaslicommented, Jul 8, 2021

What was happening on my end was that although I was able to do az login in WSL, the .azure folder was being saved under the Windows user path instead.

This is because you are calling az installed on Windows, instead of the one installed on WSL. You may follow Install the Azure CLI on Linux to install on Ubuntu.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Terraform: Azure CLI Authorization Profile was not found ...
azurerm: Error building AzureRM Client: Azure CLI Authorization Profile was not found. Please ensure the Azure CLI is installed and then log-in ......
Read more >
Error building AzureRM Client: Azure CLI ... - HashiCorp Discuss
I am able to create Azure VM successfully using terraform CLI. ... Please ensure the Azure CLI is installed and then log-in with...
Read more >
Azure CLI Authorization Profile was not found - MSDN
provider.azurerm: Error building AzureRM Client: Azure CLI ... Please ensure the Azure CLI is installed and then log-in with `az login`.
Read more >
Error populating Client ID from the Azure CLI: No ...
... building AzureRM Client: Error populating Client ID from the Azure CLI: No Authorization Tokens were found - please re-authenticate using `az login`....
Read more >
Using Terraform's Azure provider (azurerm) with GitHub ...
Error building AzureRM Client : obtain subscription() from Azure CLI: ... for the Azure CLI: exit status 1: ERROR: Please run 'az login'...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found