azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

New cloud shell had expired access token for CLI

Open gbowerman opened this issue 9 years ago • 7 comments

Launching a new cloud shell and running an az command resulted in: "The access token expiry UTC time '8/28/2017 12:46:41 AM' is earlier than current UTC time '8/28/2017 11:14:23 PM'. cloud_shell

gbowerman avatar Aug 29 '17 01:08 gbowerman

image I've come across the same thing in the last couple of days. Seems to be 1 login/subscription one Azure Directory rather than logins/subscriptions in another Azure Diretory. Sometimes if I let it timeout, and hit enter to request another session in the CLI, the issue goes away (requesting another Azure Container instance I believe - can't confirm) but seems to occur frequently in the scenario where it does occur

rswe avatar Sep 11 '17 21:09 rswe

unfortunately, there is no way to diagnose the root cause till cloud shell picks up the newer CLI drop which prints out the host container name we can use to cross check the tracing to figure out the right party to investigate, say, either cloud shell has not passed on the up to date credentials to CLI or CLI just failed to refresh.

yugangw-msft avatar Sep 19 '17 22:09 yugangw-msft

Have the same issue today, after I left Azure portal open for the previous night. Now I get the same error message: 'The access token expiry UTC time '10/3/2017 2:50:31 PM' is earlier than current UTC time'. I restarted web CLI, logged off and back on Azure portal - but the problem persists.

I also tried to do 'azure login' in hope it will refresh the token. It asked me to enter a code on Azure login page. After I entered the code, verified that it comes from Azure CLI and hit 'Continue", the login page stays as it is and I have a rolling bar after '|info: To sign in, use a web browser to open the page https://aka.ms/devicelogin and enter the code XXXXXXX to authenticate.' message in CLI window. So the authentication process is stuck.

alexbez avatar Oct 04 '17 05:10 alexbez

I am experiencing the same here with the identical message and leaving the portal open as well. Re-opening didn't have any effect.
The Azure Status Page shows a warning for the cloud shell, but with a different error message. I wonder if this might be related.

Spreadcat avatar Oct 04 '17 07:10 Spreadcat

There is an infrastructure level defect being investigated in the cloud shell right now which very likely has caused CLI's credentials are not updated in time. Will update the thread when it is addressed

yugangw-msft avatar Oct 04 '17 16:10 yugangw-msft

FYI: When the issue mentioned on the status page was corrected, the CLI started working for meg again. I just tested it again (the morning after), and the scripts are still running fine. For my part this issue is no longer present and has been resolved.

Spreadcat avatar Oct 05 '17 06:10 Spreadcat

@Spreadcat, yep, the cloud shell team has mitigated the issue mentioned here last week. For the original issue, anyone who still ran into it, please post newer error message here.

yugangw-msft avatar Oct 09 '17 23:10 yugangw-msft