Auto Upgrade ignores `--only-show-errors`
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### Describe the bug
If you have auto upgrade enabled (`az config set auto-upgrade.enable=yes`), have an out of date Azure CLI and try to run the and run a command with `--only-show-errors`, the auto upgrade will write warning messages when the CLI is out of date.
If I pass `--only-show-errors` then I don't expect warnings to be shown.
### Related command
Seems to be all commands
### Errors
No error message - just unexpected warnings
### Issue script & Debug output
```ps
az account get-access-token --query expiresOn --only-show-errors
```
output:
```
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Your current Azure CLI version is 2.58.0. Latest version available is 2.60.0.
Please check the release notes first: https://docs.microsoft.com/cli/azure/release-notes-azure-cli
Do you want to continue? (Y/n):
```
### Expected behavior
The auto upgrade shouldn't have printed any warnings, nor prompt for me to upgrade since I explicitly told the command to only output errors (with `--only-show-errors`).
### Environment Summary
azure-cli 2.58.0 *
core 2.58.0 *
telemetry 1.1.0
Extensions:
resource-graph 2.1.0
Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2
### Additional context
May be related to #28875.
Contributor guide
Assessment
This issue has not been assessed yet.