[Profile] az account get-access-token: Return expires_on as POSIX timestamp#27476
[Profile] az account get-access-token: Return expires_on as POSIX timestamp#27476
az account get-access-token: Return expires_on as POSIX timestamp#27476Conversation
🔄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.
dbradish-microsoft
left a comment
There was a problem hiding this comment.
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 |
Close #19700
Related command
az account get-access-tokenDescription
Returning
expiresOnas 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-tokenreturnexpires_onas 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: