Skip to content

Suppress warnings in production environments #30950

@sbreit-tomra

Description

@sbreit-tomra

Related command

az (applies to any command)

Is your feature request related to a problem? Please describe.

It kind of is related to issues like #29640. In that particular case, the CLI will work properly. However, on each invocation, there is output to STDERR. This output is not helpful for the execution of the CLI itself at all. Instead, it just clutters the screen, making the actual output harder to read in some cases.
In addition to that, it might fail pipelines.

Describe the solution you'd like

As a default, az should suppress warnings, to keep the output clean.

Original az invocation (via /usr/sbin/az):
/opt/azure-cli/bin/python -m azure.cli "$@"

Proposed change:
/opt/azure-cli/bin/python -W ignore -m azure.cli "$@"

Describe alternatives you've considered

One could consider adding 2> /dev/null to every invocation, but that supresses legit output to STDERR as well and therefore is no real alternative.
Don't know enough about Python, but packaging the cli with the runtime environment comes to mind.

Additional context

Metadata

Metadata

Assignees

Labels

Azure CLI TeamThe command of the issue is owned by Azure CLI teamcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions