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

Terraform and Azure CLI JWT token issue #1032

Closed
rohrerb opened this issue Mar 27, 2018 · 2 comments
Closed

Terraform and Azure CLI JWT token issue #1032

rohrerb opened this issue Mar 27, 2018 · 2 comments

Comments

@rohrerb
Copy link
Contributor

rohrerb commented Mar 27, 2018

Hello,

When using az login with terraform it seems that your session is only good for 45 minutes to a hour. After that you get the following error "provider.azurerm: No valid (unexpired) Azure CLI Auth Tokens found. Please run az login."

az login itself should be good for up to 14 hours - https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest

After using az login it places a jwt token in ~.azure/accessTokens.json and its clear that Terraform itself never modifies this token. If you look at the jwt token you can see that the expiration is set to around 14 hours.

After being prompted by terraform to login, I verified that the token itself wasn't expired and was still functioning. I was easily able to run any az command in the same bash window that i was running terraform in. What is odd is that after running (az account list) or (az vm list) I was then able to run terraform plan with no prompt to run az login. Does terraform cache or keep a separate expiration of the jwt token?

-Any Ideas what is happening?

@rohrerb
Copy link
Contributor Author

rohrerb commented Mar 27, 2018

Found answer here - #502

Thank you @jeffreyCline

@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants