Skip to content
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

az account show performance #20314

Open
danijam opened this issue Nov 12, 2021 · 2 comments
Open

az account show performance #20314

danijam opened this issue Nov 12, 2021 · 2 comments
Assignees
Labels
Account az login/account customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request
Milestone

Comments

@danijam
Copy link

danijam commented Nov 12, 2021

Describe the bug
I spend most of my time using Azure through the CLI and have many different subscriptions. To help give me persistent visual context of which subscription I am currently operating against I make use of the PowerShell module oh-my-posh to display in my prompt the current Azure subscription name context. To show this oh-my-posh runs the command az account show this command is slow and therefore slows down my overall CLI experience as oh-my-posh has to wait for az account show to complete before it can render the prompt.

To Reproduce
Run at a PowerShell prompt measure-command { az account show }

Expected behavior
I'd expect this to be under <50ms but is actually over 500ms

Environment summary
Using az cli v2.30.0

Additional context
I have about 43 subscriptions available under az account list

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Nov 12, 2021
@yonzhan yonzhan added the Account az login/account label Nov 12, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Nov 12, 2021
@yonzhan yonzhan removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Nov 12, 2021
@yonzhan yonzhan added this to the Backlog milestone Nov 12, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 12, 2021

@jiasli for awareness

@jiasli
Copy link
Member

jiasli commented Nov 13, 2021

I think you are using this? https://ohmyposh.dev/docs/az

We have already boosted Azure CLI performance from around 3000ms to 500ms via different methods:

az account show now takes around 500ms:

> Measure-Command { az account show }

TotalMilliseconds : 507.024

This is really the best we can get. Perhaps Oh My Posh can directly read from ~/.azure/azureProfile.json to get better performance? Even though directly reading this file is not supported, we haven't changed its schema for many years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Account az login/account customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request
Projects
None yet
Development

No branches or pull requests

3 participants