WSL 2 On Windows 11 Time Zone Error

If you try to run Microsoft Azure AZ commands using Azure CLI you receive a time zone error message as shown below.

The command failed with an unexpected error. Here is the traceback:
0. The ID token is not yet valid. Make sure your computer's time and time zone are both correct

To fix the problem, from a WSL 2 terminal, run the following command.

sudo hwclock -s

If the above command is not fixing the problem, run the following command from a PowerShell terminal.

 wsl --shutdown

If you try and run another Az CLI command, you won’t receive any error message.


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.