Open cataggar opened 8 months ago
~/ms/azure-sdk-for-rust> az version --output json
{
"azure-cli": "2.54.0",
"azure-cli-core": "2.54.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"vmware": "5.0.2"
}
}
~/ms/azure-sdk-for-rust> az account get-access-token --output json
{
"accessToken": "MuchLonger_NotTheRealOne_Sv8Orn0Wq0OaXuQEg",
"expiresOn": "2024-01-01 19:23:16.000000",
"expires_on": 1704158596,
"subscription": "33b83be5-faf7-42ea-a712-320a5f9dd111",
"tenant": "065e9f5e-870d-4ed1-af2b-1b58092353f3",
"tokenType": "Bearer"
}
Instead of parsing the az-cli version, can we just check if expires_on exists and use that, otherwise use expiresOn?
Based on the az-cli PR linked above, this looks potentially feasible.
This is a follow up to #1532 to check
az version
in theAzureCliCredential::create
function.The version check could also be used in combination with a feature to determine if the
expires_on
can be used instead ofexpireOn
. It was fixed in Azure CLI 2.54.0 https://github.com/Azure/azure-cli/pull/27476#issuecomment-1835432354.