Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChainedTokenCredential: Filed to acquire a token #491

Open
argonorth opened this issue Apr 30, 2024 · 3 comments
Open

ChainedTokenCredential: Filed to acquire a token #491

argonorth opened this issue Apr 30, 2024 · 3 comments

Comments

@argonorth
Copy link

argonorth commented Apr 30, 2024

Hi team,

A few months ago, I noticed AzAPI authentication became very unstable, exhibiting intermittent behavior during the authentication process. The error occurs during the Terraform Plan phase. Lately, the failure ratio during authentication has increased significantly, reaching around 95%.

I'm currently using authentication based on a Service Principal
The issue occurs in any version greater than 1.11, including the new 1.13.1.

image

As a workaround, I downgraded the AzApi version to 1.11. It's now working flawlessly.

@ms-henglu
Copy link
Collaborator

Hello @argonorth ,

Thank you for taking time to report this!

Which way are you using to authenticate with Azure? If you're not using the managed identity, you could turn it off by setting "use_msi = false" in the provider block. I'll keep investigating the root cause for this issue.

@argonorth
Copy link
Author

Hey @ms-henglu
I am currently using Service Principal and Client Secret authentication. When using version 1.13.1 and setting use-msi to false, I receive the following error.

provider "azapi" {
  use_msi = false
}

image

@ms-henglu
Copy link
Collaborator

Would you please share the debug logs?

Here's how:

  1. Add the following two environment variables:
    TF_LOG=DEBUG
    TF_LOG_PATH=./terraform.log
  2. Run terraform plan command, the logs will be save to the terraform.log file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants