Azure / Azure/azure-cli

Auto Upgrade ignores `--only-show-errors`

Open
#28,876 2 comments 0 reactions 2 assignees Claimed by @jiasli View on GitHub
act-codegen-extensibility-squad act-identity-squad ARM Auto-Assign Auto-Resolve Azure CLI Team Configure customer-reported question
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.