az command argument '--list -o table' leads to infinite extension install prompt
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
## Describe the bug
When running "az [resource such as webapp, network vnet, etc] **--list** -o table" (note the -- in front of "list") you are prompted over and over to install the latest extension. It should have just given an error message.
**Command Name**
`az webapp --list -o table`
or
`az network vnet --list -o table`
**Errors:**
Output prompts to install the extension over and over again:
```
The command requires the extension webapp. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n): Y
Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt.
The installed extension 'webapp' is in preview.
The command requires the extension webapp. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n): Y
Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt.
Extension 'webapp' 0.3.1 is already installed.
It will be updated if available.
No updates available for 'webapp'. Use --debug for more information.
The command requires the extension webapp. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n):
Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt.
Extension 'webapp' 0.3.1 is already installed.
It will be updated if available.
No updates available for 'webapp'. Use --debug for more information.
...
```
If you enable dynamic install (via `az config set extension.use_dynamic_install=yes_without_prompt`), you get:
```
The command requires the extension webapp. It will be installed first.
Extension 'webapp' 0.3.1 is already installed.
It will be updated if available.
No updates available for 'webapp'. Use --debug for more information.
The command requires the extension webapp. It will be installed first.
Extension 'webapp' 0.3.1 is already installed.
It will be updated if available.
No updates available for 'webapp'. Use --debug for more information.
The command requires the extension webapp. It will be installed first.
Extension 'webapp' 0.3.1 is already installed.
It will be updated if available.
No updates available for 'webapp'. Use --debug for more information.
The command requires the extension webapp. It will be installed first.
Extension 'webapp' 0.3.1 is already installed.
It will be updated if available.
...
```
## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
`az webapp --list -o table`
or
`az network vnet --list -o table`
## Expected Behavior
A better error message
## Environment Summary
```
Linux-4.15.0-1113-azure-x86_64-with-debian-10.2 (Cloud Shell)
Python 3.6.10
Installer: DEB
azure-cli 2.22.0 *
Extensions:
webapp 0.3.1
ai-examples 0.2.5
ssh 0.1.4
```
## Additional Context
Contributor guide
Assessment
This issue has not been assessed yet.