az login timeout?

See original GitHub issue

I’m writing a script that needs to handle az login expiration. To test it, I have to be able to tell az login to expire after a certain amount of time. I don’t want to az logout. I want the az to be cached, just expired.

Is there a way to do that or hack something to mimic that behavior?


Environment summary

Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
amswordcommented, Aug 21, 2020

Hello @yugangw-msft , recently i find the credential is invalidated soon after i run az login. Supposedly, it should be 3 months, but now, it is a few days (~ 2 days). any suggestion to fix it?

1reaction
yugangw-msftcommented, Apr 6, 2018

For testing, maybe you can just delete the ~/.azure/accessTokens.json? (for windows it is under C:\Users\<user>\.azure)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to stay logged in with azure cli? - Stack Overflow
To get it working again I had to do az login and reauthenticate. How long will the account stay logged in before having...
Read more >
Sign in with Azure CLI — Login and Authentication
Sign in with credentials on the command line ; read -sp "Azure password: " ; echo && az login -u <username> -p $AZ_PASS....
Read more >
Azure CLI deployment task timeout - Visual Studio Feedback
We're seeing long times for the task to log in, and timeout in some cases. ... (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" login --service-principal -u ...
Read more >
How Azure CLI Manages Your Access Tokens | Mikhail Shilkov
Azure login. The very first command that you run after installing the CLI on your development machine is going to be az login....
Read more >
Configure Session Timeout - SAP Help Portal
As a tenant administrator, you can configure when the session, created at the Identity Authentication tenant, expires.
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