-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Profile] az account get-access-token
: Return expires_on
as POSIX timestamp
#27476
Conversation
🔄AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
improve expires_on |
As indicated in Azure#1371, there are numerous issues with handling the az-cli's output of an access token's expiration date when it comes to time zones. An update to the Azure CLI is in progress that will add a _new_ field that will handle the conversion, currently tracked as Azure/azure-cli#27476. We should make use of this new feature once it's available, but we should also keep this functionality as a fallback for supporting older Azure CLIs.
As indicated in #1371, there are numerous issues with handling the az-cli's output of an access token's expiration date when it comes to time zones. An update to the Azure CLI is in progress that will add a _new_ field that will handle the conversion, currently tracked as Azure/azure-cli#27476. We should make use of this new feature once it's available, but we should also keep this functionality as a fallback for supporting older Azure CLIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested change: Add the PEP 495 link if it aligns with engineering URL best practices.
This PR has been released in Azure CLI 2.54.0. Whether using One thing is for sure: The access token returned by
If you want better compatibility with old versions of Azure CLI, you may allow falling back to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need support
Close #19700
Related command
az account get-access-token
Description
Returning
expiresOn
as a local datetime is a legacy from the ADAL age. It causes lots of unnecessary complexities. See #19700 for detailed explanation.This PR makes
az account get-access-token
returnexpires_on
as POSIX timestamp which has been supported long ago by Azure CLI Core during the MSAL migration (#19853).However, as shown in #19700 (comment), downstream applications that only support 32-bit integer precision timestamp will encounter error in year 2038, but that's not something we can control.
Testing Guide
Before:
After: