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

Tab completion is incredibly slow and picky about formatting #9157

Open
jboulter11 opened this issue Apr 19, 2019 · 35 comments
Open

Tab completion is incredibly slow and picky about formatting #9157

jboulter11 opened this issue Apr 19, 2019 · 35 comments
Assignees
Labels
Auto Complete Core CLI core infrastructure customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request Performance
Milestone

Comments

@jboulter11
Copy link

jboulter11 commented Apr 19, 2019

Describe the bug

Tab completion is painfully slow. See repro.

Command Name
az

Errors:

To Reproduce:

  1. Properly configure tab completion for your shell, I'm in zsh but this all holds true in bash as well.
  2. Type az in the terminal
  3. Hit tab, it adds a space instead of giving you tab completion.
  4. Hit tab again, wait 1-2 seconds for tab completion to process
  5. After a wait, tab completion displays a list of completions.

Another example:

  1. Type az devops or az boards in the terminal
  2. Hit tab, wait ~5 seconds
  3. Get -- no matches found -- output.
  4. Hit space, hit tab
  5. Wait ~1s get a bunch of completions

Expected Behavior

A response should be given immediately with no delay and it should not be picky about whether there is a space after the last command.

The entire autocompletion process is way too slow. Type git and hit tab and you get an instant response with completions with nice formatting. This has got to be better in the azure cli. 1-2s is too long, but 5 seconds is just shameful especially having it return no results after, only to work after hitting space.

Please let me know if you need any more information to help prioritize this work, feel free to reach out to me via email or teams via my alias: jiboulte.

Environment Summary

Darwin-18.2.0-x86_64-i386-64bit
Python 3.7.3
Shell: bash

azure-cli                         2.0.62

Extensions:
azure-devops                       0.4.0

Python location '/usr/local/Cellar/azure-cli/2.0.62/libexec/bin/python'
Extensions directory '/Users/jiboulte/.azure/cliextensions'

Python (Darwin) 3.7.3 (default, Apr 19 2019, 09:07:31) 
[Clang 10.0.1 (clang-1001.0.46.3)]

Additional Context

@limingu
Copy link
Member

limingu commented Apr 19, 2019

It can't repro on Windows. It may be Mac/Linux only issue.

@limingu
Copy link
Member

limingu commented Apr 19, 2019

@jboulter11 , can you try other commands (not az) to see if it has the same issue. I think it may the OS issue not az command issue.

@jboulter11
Copy link
Author

Other commands provide an instant response. az and its nested commands are what is slow, my OS is fine.

@limingu limingu added Core CLI core infrastructure Needs Triage labels Apr 19, 2019
@adewaleo
Copy link
Contributor

@tjprescott, @limingu, I would be interested in this post build. We should try and imitate powershell. Maddie once mentioned how they cache tab completions...

@haroldrandom haroldrandom added Core CLI core infrastructure Performance labels Oct 25, 2019
@yonzhan yonzhan added this to the S164 milestone Dec 8, 2019
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 8, 2019

add to S164.

@yonzhan yonzhan modified the milestones: S164, S165 Feb 1, 2020
@yonzhan yonzhan modified the milestones: S165, S166 Feb 15, 2020
@nickamon
Copy link

I second the observation provided here. I'm on a mac, first time using AZ CLI and first thing I noticed is wow, this command completion is super slow. Googled the issue hoping to find a resolution and this issue report is the first thing I came across.

@jiasli
Copy link
Member

jiasli commented Feb 27, 2020

The slowness is due to the fact that auto-complete is achieved by calling az again with the prefix given in the terminal. Azure CLI now contains thousands of commands and loading these commands makes it slow.

We will try to improve the performance in the future.

@jiasli jiasli modified the milestones: S166, Backlog Feb 27, 2020
@azure-sdk azure-sdk added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Sep 24, 2020
@nadi-noda
Copy link

13/02/2021 still too slow

@tsujp
Copy link

tsujp commented Jun 8, 2021

This is still extremely slow on Linux.

Python (Linux) 3.9.2 (default, Feb 20 2021, 00:00:00) 
[GCC 11.0.0 20210210 (Red Hat 11.0.0-0)]

@faustinopalma
Copy link

The CLI autocompletion is still very slow.
E.g.
typing: az stor
hitting: tab
it takes about 10 seconds to complete to "az storage"

I just installed Ubuntu 20.04 LTE under WFL on a Surface book 3. The Windows OS is fully up to date.
To install the CLI, I used the following simplified command:
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

Is there any recommended configuration under Windows that is known to work properly? E.g. maybe trying with a different distribution or different installation procedure for the cli?

@jiasli
Copy link
Member

jiasli commented Jun 21, 2021

With the introduction of Command Index (#13294), the execution and auto-complete speed of az has been significantly improved.

On my local machine's Ubuntu 20.04 running on WSL 2, when I type az stotab, the auto-complete now takes 1~2 seconds.

Is there any recommended configuration under Windows that is known to work properly?

Auto-complete currently doesn't work on Windows. Are you using WSL instead of "WFL"? In that case, could you try WSL 2 which greatly improves the performance of the Linux subsystem?

@faustinopalma
Copy link

Thank you very much Jiashuo. I have moved to WSL 2 and now the autocomplete is very fast.
It takes less than a second to complete a command.

@jiasli
Copy link
Member

jiasli commented Jun 21, 2021

@faustinopalma, I am glad to know it works well for you. 😊

@Brokenin
Copy link

Brokenin commented Nov 4, 2021

Still slow for me is take 1-2 second (WSL2)

@Bailey-T
Copy link

Tab completion still slow for me on MacOS 11.16.1.
1~2 seconds for some commands, but that's still far too slow especially when they don't have many options.
Example: Double tab kubectl get is way faster than az account double tab.

azure-cli 2.30.0
core 2.30.0
telemetry 1.0.6
Python (Darwin) 3.9.8 (main, Nov 10 2021, 09:21:22)
[Clang 13.0.0 (clang-1300.0.29.3)]

@et304383
Copy link

et304383 commented Dec 15, 2021

Absolutely appalling performance on MacOS. This is completely unacceptable. AWS CLI completion is nearly instantaneous and they have just as many commands, if not more, than you.

Microsoft, please stop developing CLI tools with a Windows first attitude.

@NiklasReisser
Copy link

On Linux still pretty slow (~2 seconds)

Looks like atleast on Linux az also always makes a call to some Microsoft server whenever I invoke bash completion (Not only when it would provide a useful completion this way)

@eswues
Copy link

eswues commented Mar 3, 2022

slow as turtle. regular tasks are so anoying that sometimes I just prefere click-click way.
Why don't you guys just fix it, you are MS right 😄 😄

@samba2
Copy link

samba2 commented Mar 18, 2022

same here. On Windows 11 + WSL2. ac account takes 2-3 seconds. Please fix.

@navratiljan
Copy link

Issue still persist in Win 10 + WSL2

@ash-dey
Copy link

ash-dey commented Nov 22, 2022

I am surprised that even after more than 3 years the issue has not been resolved. Tab completion is so slow that it is not usable. MS please do something about it or remove the feature. Whats the use of a feature if it is not usable? Tried in both Windows and Linux same result, painfully s.....l......o......w

@bpkroth
Copy link

bpkroth commented Nov 22, 2022

I looked at this briefly and it seem to have to do with how az is built fundamentally.

The trouble is that az (and many of its extensions) are all in python and package all of their dependencies separately, even if some may overlap.
Each time a tab completion event happens in the shell, an az (python) fork/exec happens to enumerate the options, which (depending on context) may load/parse/interpret/etc. all of the python lib dependencies for each extension as well, which can be massive, and may depend upon which extensions you have downloaded as well (e.g. arcdata).

Compare this with say aws (compiled, with a separate completer tool) or kubectl (compiled, with a cached shell specific completer output) and there is just far less work to do in either of those other two.

Without completely rewriting the basics of how the tool is structured so that it could be compiled, this seems hard to fix.

One possibility is a sort of caching mechanism (perhaps via a separate completer executable) that could potentially enumerate all of the basic tab completion command options (but not local variable/subscription/etc. options) once and only re-evaluate them upon extension or tool addition/upgrade. That would turn the several seconds stall into an infrequent event for tab completions, but would still suffer the couple of seconds to load all the libraries once you actually invoke the command.

@bebound
Copy link
Contributor

bebound commented Nov 23, 2022

Azure-cli uses argcomplete for completion. It has to executes the underlying script every time TAB is pressed, so it's slower than other cli tools, but not that much.

The completion time is nearly the same as -h command. az account -h --debug takes 0.3s on Ubuntu and 0.8s on WSL2.

@ash-dey which command are you using, could you please send me the output of it with -h --debug param? If you run it multiple times, does the time decrease?

@drtbz
Copy link

drtbz commented Nov 23, 2022

@bebound - it's no where near that fast on Mac, see below. A second run of --debug comes back faster, about 1.2s, and it's consistent in subsequent runs so I'm assuming it generates a cache, but this doesn't appear to work for tab completion as from shell, if I double tab to see options it takes between 3 and 10 seconds to return on az aks

ᐅ az aks -h --debug
cli.knack.cli: Command arguments: ['aks', '-h', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x10b4e0550>, <function OutputProducer.on_global_arguments at 0x10b541ab0>, <function CLIQuery.on_global_arguments at 0x10b576ef0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'aks': ['azext_aks_preview', 'azure.cli.command_modules.acs']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: acs                       0.532         6        46
cli.azure.cli.core: Total (1)                 0.532         6        46
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
cli.knack.cli: Event: CommandLoader.OnLoadCommandTable []
cli.azure.cli.core: aks-preview               0.030        10        60  /Users/Tom.Bailey/.azure/cliextensions/aks-preview
cli.azure.cli.core: Total (1)                 0.030        10        60
cli.azure.cli.core: Loaded 12 groups, 73 commands.
cli.azure.cli.core: Found a match in the command group table for 'aks'.
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x10c075090>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/Tom.Bailey/.azure/commands/2022-11-23.09-12-08.aks.335.log'.
az_command_data_logger: command args: aks -h --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x10c14dab0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x10c17c280>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x10c17c3a0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []

Group
    az aks : Manage Azure Kubernetes Services.

Subgroups:
    addon                          : Commands to manage and view single addon conditions.
    command                        : See detail usage in 'az aks command invoke', 'az aks command
                                     result'.
    draft                          : Commands to build deployment files in a project directory and
                                     deploy to an AKS cluster.
    egress-endpoints               : Commands to manage egress endpoints in managed Kubernetes
                                     cluster.
    maintenanceconfiguration       : Commands to manage maintenance configurations in managed
                                     Kubernetes cluster.
    nodepool                       : Commands to manage node pools in managed Kubernetes cluster.
    oidc-issuer                    : Oidc issuer related commands.
    pod-identity                   : Commands to manage pod identities in managed Kubernetes
                                     cluster.
    snapshot                       : Commands to manage cluster snapshots.

Commands:
    browse                         : Show the dashboard for a Kubernetes cluster in a web browser.
    check-acr                      : Validate an ACR is accessible from an AKS cluster.
    create                         : Create a new managed Kubernetes cluster.
    delete                         : Delete a managed Kubernetes cluster.
    disable-addons                 : Disable Kubernetes addons.
    enable-addons                  : Enable Kubernetes addons.
    get-credentials                : Get access credentials for a managed Kubernetes cluster.
    get-os-options                 : Get the OS options available for creating a managed Kubernetes
                                     cluster.
    get-upgrades                   : Get the upgrade versions available for a managed Kubernetes
                                     cluster.
    get-versions                   : Get the versions available for creating a managed Kubernetes
                                     cluster.
    install-cli                    : Download and install kubectl, the Kubernetes command-line tool.
                                     Download and install kubelogin, a client-go credential (exec)
                                     plugin implementing azure authentication.
    kanalyze                       : Display diagnostic results for the Kubernetes cluster after
                                     kollect is done.
    kollect                        : Collecting diagnostic information for the Kubernetes cluster.
    list                           : List managed Kubernetes clusters.
    remove-dev-spaces [Deprecated] : Remove Azure Dev Spaces from a managed Kubernetes
                                     cluster.
    rotate-certs                   : Rotate certificates and keys on a managed Kubernetes cluster.
    scale                          : Scale the node pool in a managed Kubernetes cluster.
    show                           : Show the details for a managed Kubernetes cluster.
    start                          : Starts a previously stopped Managed Cluster.
    stop                           : Stops a Managed Cluster.
    update                         : Update the properties of a managed Kubernetes cluster.
    update-credentials             : Update credentials for a managed Kubernetes cluster, like
                                     service principal.
    upgrade                        : Upgrade a managed Kubernetes cluster to a newer version.
    use-dev-spaces    [Deprecated] : Use Azure Dev Spaces with a managed Kubernetes
                                     cluster.
    wait                           : Wait for a managed Kubernetes cluster to reach a desired state.

To search AI knowledge base for examples, use: az find "az aks"

urllib3.connectionpool: Starting new HTTPS connection (1): azure.microsoft.com:443
urllib3.connectionpool: https://azure.microsoft.com:443 "HEAD / HTTP/1.1" 301 0
cli.azure.cli.core.util: Connectivity check: 0.17484789999434724 sec
urllib3.connectionpool: Starting new HTTPS connection (1): raw.githubusercontent.com:443
urllib3.connectionpool: https://raw.githubusercontent.com:443 "GET /Azure/azure-cli/main/src/azure-cli-core/setup.py HTTP/1.1" 200 1246
urllib3.connectionpool: Starting new HTTPS connection (1): raw.githubusercontent.com:443
urllib3.connectionpool: https://raw.githubusercontent.com:443 "GET /Azure/azure-cli/main/src/azure-cli-telemetry/setup.py HTTP/1.1" 200 679
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x10c0752d0>]
az_command_data_logger: exit code: 0
cli.__main__: Command ran in 2.136 seconds (init: 0.599, invoke: 1.537)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3257 in cache
telemetry.check: Returns Positive.
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/usr/local/Cellar/azure-cli/2.42.0/libexec/bin/python /usr/local/Cellar/azure-cli/2.42.0/libexec/lib/python3.10/site-packages/azure/cli/telemetry/__init__.py /Users/Tom.Bailey/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

@bebound
Copy link
Contributor

bebound commented Nov 24, 2022

@TomBailey-N Thanks for the info.
The first run is a bit slow because it checked new version from GitHub.
I tried this command on my Mac but I can't reproduce.

What's the output of this command? time IFS=$'\013' COMP_LINE='az aks ' COMP_POINT=6 COMP_TYPE="" _ARGCOMPLETE=1 _ARGCOMPLETE_SUPPRESS_SPACE=1 az 8>&1 9>&2 1>/dev/null 2>/dev/null

Does the command run faster after running az config set core.collect_telemetry=false?

@johnib
Copy link

johnib commented Dec 17, 2022

Still very slow, on the fastest macbook available today.

Any update?

@bebound
Copy link
Contributor

bebound commented Dec 19, 2022

@johnib Can you give me an example of the command when you press <TAB>?

If the last word is not complete, it’s a lot slower than it should be. I’ve found a way to fix it. For example: az account is complete, but az account sh is not complete.
Could you please also compare the speed of complete command, does it run faster?

@eswues
Copy link

eswues commented Dec 26, 2022

@johnib Can you give me an example of the command when you press <TAB>?

If the last word is not complete, for example: az account is complete, but az account sh is not complete. Could you please also compare the speed of complete command, does it run faster?

are you serious?
people who use az cli are sysadmins with good level of knowledge about the console and its use.
az cli is very slow tool when compering to any cli tool I use. Hope it will get more usefull one day.

@johnib
Copy link

johnib commented Dec 28, 2022

@johnib Can you give me an example of the command when you press <TAB>?

If the last word is not complete, it’s a lot slower than it should be. I’ve found a way to fix it. For example: az account is complete, but az account sh is not complete. Could you please also compare the speed of complete command, does it run faster?

Not sure if it ran much faster or not.. it's still slow compared to other CLIs (aws for instance). Not having auto-completion on a CLI significantly reduces usage with it.

Currently I'm using the Az powershell module instead (on a macOS...) just because it's faster in its auto-completion.

Given you acknowledge the slowness, please let us know what are the plans (if at all) and timelines to fix this.

Thank you!

@bebound
Copy link
Contributor

bebound commented Dec 29, 2022

I hope the completion can be finished in 1 second.

For now, the help command reaches the target.

I think argcomplete can generate completion in the same time, but I'm wrong. I'll do some investigation about it.


The reason why autocomplete is slower than -h command is the recommendation. It is fixed in #25145


Here is the result of time az account -h and time IFS=$'\013' COMP_LINE='az account' COMP_POINT=11 COMP_TYPE="" _ARGCOMPLETE=1 _ARGCOMPLETE_SUPPRESS_SPACE=0 az 8>&1 1>&2 2>&2 9>&1 on different OS. It's slow on WSL and Mac.

WSL Ubuntu

0.28s user 0.05s system 79% cpu 0.415 total
0.26s user 0.04s system 36% cpu 0.841 total

Mac

0.18s user 0.06s system 95% cpu 0.246 total
0.20s user 0.06s system 29% cpu 0.858 total

Linux

0.22s user 0.01s system 96% cpu 0.232 total
0.25s user 0.02s system 58% cpu 0.470 total

@bebound
Copy link
Contributor

bebound commented Jul 7, 2023

There is a significant performance improvement in 2.49, please give it a try.

@brnl-cfit
Copy link

Is this still the way to go for zsh?
~/.zshrc:

# az shell completion
autoload -U +X bashcompinit && bashcompinit
source /etc/bash_completion.d/azure-cli

Because it is still too slow for me.

# az version 
{
  "azure-cli": "2.51.0",
  "azure-cli-core": "2.51.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {}
}

@bebound
Copy link
Contributor

bebound commented Aug 22, 2023

Yes
Which command are you using when pressing Tab?
Please provide the output of {your_command} --debug and az -v

@brnl-cfit
Copy link

Hmm, even just running az is slow. Is that the problem to fix?

az --debug

cli.knack.cli: Command arguments: ['--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f459cb3ec20>, <function OutputProducer.on_global_arguments at 0x7f459c919480>, <function CLIQuery.on_global_arguments at 0x7f459c972830>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: No module found from index for '['--debug']'
cli.azure.cli.core: Loading all modules and extensions
cli.azure.cli.core: Discovered command modules: ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'aro', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'config', 'configure', 'consumption', 'container', 'cosmosdb', 'databoxedge', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'identity', 'interactive', 'iot', 'keyvault', 'kusto', 'lab', 'managedservices', 'maps', 'marketplaceordering', 'monitor', 'mysql', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'resource', 'role', 'search', 'security', 'servicebus', 'serviceconnector', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'synapse', 'util', 'vm']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: acr                       0.366        34       144
cli.azure.cli.core: acs                       0.045         7        54
cli.azure.cli.core: advisor                   0.002         3         6
cli.azure.cli.core: ams                       0.017        22       100
cli.azure.cli.core: apim                      0.006        14        68
cli.azure.cli.core: appconfig                 0.004         9        47
cli.azure.cli.core: appservice                0.123        73       260
cli.azure.cli.core: aro                       0.029         1         9
cli.azure.cli.core: backup                    0.006        16        58
cli.azure.cli.core: batch                     0.102        34       102
cli.azure.cli.core: batchai                   0.004        10        30
cli.azure.cli.core: billing                   0.007        19        52
cli.azure.cli.core: botservice                0.003        12        42
cli.azure.cli.core: cdn                       0.008        39       133
cli.azure.cli.core: cloud                     0.002         1         7
cli.azure.cli.core: cognitiveservices         0.003        10        33
cli.azure.cli.core: config                    0.001         2         7
cli.azure.cli.core: configure                 0.001         2         5
cli.azure.cli.core: consumption               0.003         8         9
cli.azure.cli.core: container                 0.048         1        11
cli.azure.cli.core: cosmosdb                  0.018        58       192
cli.azure.cli.core: databoxedge               0.004         5        27
cli.azure.cli.core: dla                       0.004        23        62
cli.azure.cli.core: dls                       0.003         7        41
cli.azure.cli.core: dms                       0.002         3        22
cli.azure.cli.core: eventgrid                 0.006        25        96
cli.azure.cli.core: eventhubs                 0.028        13        19
cli.azure.cli.core: extension                 0.001         1         7
cli.azure.cli.core: feedback                  0.001         1         2
cli.azure.cli.core: find                      0.001         1         1
cli.azure.cli.core: hdinsight                 0.013         8        39
cli.azure.cli.core: identity                  0.002         2        11
cli.azure.cli.core: interactive               0.001         1         1
cli.azure.cli.core: iot                       0.185        19        82
cli.azure.cli.core: keyvault                  0.018        22       133
cli.azure.cli.core: kusto                     0.002         3        14
cli.azure.cli.core: lab                       0.006        11        34
cli.azure.cli.core: managedservices           0.002         3         8
cli.azure.cli.core: maps                      0.002         5        13
cli.azure.cli.core: marketplaceordering       0.003         1         2
cli.azure.cli.core: monitor                   0.078        26        80
cli.azure.cli.core: mysql                     0.525        13        47
cli.azure.cli.core: netappfiles               0.007        17        94
cli.azure.cli.core: network                   3.373       103       336
cli.azure.cli.core: policyinsights            0.025         9        17
cli.azure.cli.core: privatedns                0.020        14        63
cli.azure.cli.core: profile                   0.002         2         9
cli.azure.cli.core: rdbms                     0.084        44       185
cli.azure.cli.core: redis                     0.003         5        27
cli.azure.cli.core: relay                     0.003        10        37
cli.azure.cli.core: resource                  0.015        51       224
cli.azure.cli.core: role                      0.004        17        61
cli.azure.cli.core: search                    0.002         7        22
cli.azure.cli.core: security                  0.008        48       104
cli.azure.cli.core: servicebus                0.014        12        15
cli.azure.cli.core: serviceconnector          0.026        12       182
cli.azure.cli.core: servicefabric             0.071        27        76
cli.azure.cli.core: signalr                   0.002         8        30
cli.azure.cli.core: sql                       0.020        56       215
cli.azure.cli.core: sqlvm                     0.078         4        20
cli.azure.cli.core: storage                   0.126        58       272
cli.azure.cli.core: synapse                   0.018        54       246
cli.azure.cli.core: util                      0.001         3         7
cli.azure.cli.core: vm                        0.179        57       255
cli.azure.cli.core: Total (64)                5.767      1186      4607
cli.azure.cli.core: Loaded 1174 groups, 4607 commands.
cli.azure.cli.core: Updated command index in 0.003 seconds.
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f459bb8ad40>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/[REDACTED]/.azure/commands/2023-08-22.13-48-12.unknown_command.69364.log'.
az_command_data_logger: command args: --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7f459b995120>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7f459b9951b0>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7f459b9952d0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []

Welcome to Azure CLI!
---------------------
Use `az -h` to see available commands or go to https://aka.ms/cli.

Telemetry
---------
The Azure CLI collects usage data in order to improve your experience.
The data is anonymous and does not include commandline argument values.
The data is collected by Microsoft.

You can change your telemetry settings with `az configure`.


     /\
    /  \    _____   _ _  ___ _
   / /\ \  |_  / | | | \'__/ _\
  / ____ \  / /| |_| | | |  __/
 /_/    \_\/___|\__,_|_|  \___|


Welcome to the cool new Azure CLI!

Use `az --version` to display the current version.
Here are the base commands:

    account             : Manage Azure subscription information.
    acr                 : Manage private registries with Azure Container Registries.
    ad                  : Manage Azure Active Directory Graph entities needed for Role Based Access
                         Control.
    advisor             : Manage Azure Advisor.
    afd                 : Manage Azure Front Door Standard/Premium. For classical Azure Front Door,
                         please refer https://docs.microsoft.com/en-us/cli/azure/network/front-
                         door?view=azure-cli-latest.
    aks                 : Manage Azure Kubernetes Services.
    ams                 : Manage Azure Media Services resources.
    apim                : Manage Azure API Management services.
    appconfig           : Manage App Configurations.
    appservice          : Manage App Service plans.
    aro                 : Manage Azure Red Hat OpenShift clusters.
    backup              : Manage Azure Backups.
    batch               : Manage Azure Batch.
    bicep               : Bicep CLI command group.
    billing             : Manage Azure Billing.
    bot                 : Manage Microsoft Azure Bot Service.
    cache               : Commands to manage CLI objects cached using the `--defer` argument.
    capacity            : Manage capacity.
    cdn                 : Manage Azure Content Delivery Networks (CDNs).
    cloud               : Manage registered Azure clouds.
    cognitiveservices   : Manage Azure Cognitive Services accounts.
    config              : Manage Azure CLI configuration.
    configure           : Manage Azure CLI configuration. This command is interactive.
    connection          : Commands to manage Service Connector local connections which allow local
                         environment to connect Azure Resource. If you want to manage connection for
                         compute service, please run 'az webapp/containerapp/spring connection'.
    consumption         : Manage consumption of Azure resources.
    container           : Manage Azure Container Instances.
    cosmosdb            : Manage Azure Cosmos DB database accounts.
    databoxedge         : Support data box edge device and management.
    deployment          : Manage Azure Resource Manager template deployment at subscription scope.
    deployment-scripts  : Manage deployment scripts at subscription or resource group scope.
    disk                : Manage Azure Managed Disks.
    disk-access         : Manage disk access resources.
    disk-encryption-set : Disk Encryption Set resource.
    dla                 : Manage Data Lake Analytics accounts, jobs, and catalogs.
    dls                 : Manage Data Lake Store accounts and filesystems.
    dms                 : Manage Azure Data Migration Service (classic) instances.
    eventgrid           : Manage Azure Event Grid topics, domains, domain topics, system topics
                         partner topics, event subscriptions, system topic event subscriptions and
                         partner topic event subscriptions.
    eventhubs           : Eventhubs.
    extension           : Manage and update CLI extensions.
    feature             : Manage resource provider features.
    feedback            : Send feedback to the Azure CLI Team.
    find                : I'm an AI robot, my advice is based on our Azure documentation as well as
                         the usage patterns of Azure CLI and Azure ARM users. Using me improves
                         Azure products and documentation.
    functionapp         : Manage function apps. To install the Azure Functions Core tools see
                         https://github.com/Azure/azure-functions-core-tools.
    group               : Manage resource groups and template deployments.
    hdinsight           : Manage HDInsight resources.
    identity            : Managed Identities.
    image               : Manage custom virtual machine images.
    interactive         : Start interactive mode. Installs the Interactive extension if not
                         installed already.
    iot                 : Manage Internet of Things (IoT) assets.
    keyvault            : Manage KeyVault keys, secrets, and certificates.
    kusto               : Manage Azure Kusto resources.
    lab                 : Manage Azure DevTest Labs.
    lock                : Manage Azure locks.
    logicapp            : Manage logic apps.
    login               : Log in to Azure.
    logout              : Log out to remove access to Azure subscriptions.
    managed-cassandra   : Azure Managed Cassandra.
    managedapp          : Manage template solutions provided and maintained by Independent Software
                         Vendors (ISVs).
    managedservices     : Manage the registration assignments and definitions in Azure.
    maps                : Manage Azure Maps.
    mariadb             : Manage Azure Database for MariaDB servers.
    monitor             : Manage the Azure Monitor Service.
    mysql               : Manage Azure Database for MySQL servers.
    netappfiles         : Manage Azure NetApp Files (ANF) Resources.
    network             : Manage Azure Network resources.
    policy              : Manage resource policies.
    postgres            : Manage Azure Database for PostgreSQL servers.
    ppg                 : Manage Proximity Placement Groups.
    private-link        : Private-link association CLI command group.
    provider            : Manage resource providers.
    redis               : Manage dedicated Redis caches for your Azure applications.
    relay               : Manage Azure Relay Service namespaces, WCF relays, hybrid connections, and
                         rules.
    resource            : Manage Azure resources.
    resourcemanagement  : Resourcemanagement CLI command group.
    rest                : Invoke a custom request.
    restore-point       : Manage restore point with res.
    role                : Manage user roles for access control with Azure Active Directory and
                         service principals.
    search              : Manage Azure Search services, admin keys and query keys.
    security            : Manage your security posture with Microsoft Defender for Cloud.
    servicebus          : Servicebus.
    sf                  : Manage and administer Azure Service Fabric clusters.
    sig                 : Manage shared image gallery.
    signalr             : Manage Azure SignalR Service.
    snapshot            : Manage point-in-time copies of managed disks, native blobs, or other
                         snapshots.
    sql                 : Manage Azure SQL Databases and Data Warehouses.
    sshkey              : Manage ssh public key with vm.
    stack               : A deployment stack is a native Azure resource type that enables you to
                         perform operations on a resource collection as an atomic unit.
    staticwebapp        : Manage static apps.
    storage             : Manage Azure Cloud Storage resources.
    survey              : Take Azure CLI survey.
    synapse             : Manage and operate Synapse Workspace, Spark Pool, SQL Pool.
    tag                 : Tag Management on a resource.
    term                : Manage marketplace agreement with marketplaceordering.
    ts                  : Manage template specs at subscription or resource group scope.
    upgrade             : Upgrade Azure CLI and extensions.
    version             : Show the versions of Azure CLI modules and extensions in JSON format by
                         default or format configured by --output.
    vm                  : Manage Linux or Windows virtual machines.
    vmss                : Manage groupings of virtual machines in an Azure Virtual Machine Scale Set
                         (VMSS).
    webapp              : Manage web apps.
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f459bb8af80>]
az_command_data_logger: exit code: 0
cli.__main__: Command ran in 6.524 seconds (init: 0.619, invoke: 5.905)

az -v

azure-cli                         2.51.0

core                              2.51.0
telemetry                          1.1.0

Dependencies:
msal                            1.24.0b1
azure-mgmt-resource             23.1.0b2

Python location '/opt/az/bin/python3'
Extensions directory '/home/[REDACTED]/.azure/cliextensions'

Python (Linux) 3.10.10 (main, Jul 27 2023, 07:10:47) [GCC 12.2.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

@bebound
Copy link
Contributor

bebound commented Aug 22, 2023

This is expected.az is the slowest command. It loads every module in azure-cli, which can be verified from the log.
The sub commands are much faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto Complete Core CLI core infrastructure customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request Performance
Projects
None yet
Development

No branches or pull requests