az cli seems to spends time looking for account config, even if it doesn't need them #27439
Labels
Auto-Assign
Auto assign by bot
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
DevOps
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
This issue is responsible by Azure service team.
Describe the bug
While looking into what causes the az-cli to load slowly on the hosted agents of GitHub Actions and Azure pipelines I noticed that az tries to look for accounts and throws a couple of exceptions even if the account isn't needed.
In this case the access token to access Azure DevOps is supplied through the environment, yet az is trying to load accounts and spends unneeded time there.
It's hard to tell from the logs, bet between the last logged line and the error handling there is a jump of about 10 seconds in the Azure pipelines log. Would be lovely if that time waste could be prevented.
It looks like the 10 seconds was caused by the fact that Windows Update and Storage Service had reenabled on the hosted runner. Still, it's unclear why
az devopsis not using the environment variable it is given and spends extra time trying to read the credentials from the profile.Related command
Az DevOps pipelines show ...
Errors
Issue script & Debug output
Expected behavior
Account info is only loaded when needed. Lack of account data doesn't result in a swallowed error.
Environment Summary
azure-cli 2.52.0
core 2.52.0
telemetry 1.1.0
Extensions:
azure-devops 0.26.0
Dependencies:
msal 1.24.0b1
azure-mgmt-resource 23.1.0b2
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Program Files\Common Files\AzureCliExtensionDirectory'
Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
Additional context
actions/runner-images#8294
The text was updated successfully, but these errors were encountered: