You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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."
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?
The text was updated successfully, but these errors were encountered:
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
locked and limited conversation to collaborators
Mar 31, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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?
The text was updated successfully, but these errors were encountered: