azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Silencing "Please let us know how we are doing.." from the STDOUT of az commands

Open Nilubkal opened this issue 4 years ago • 10 comments

Hello , i would like to silence/remove the info msg popping up each time when executing a az cli command

Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy

tried all available options with setting the config core output to print only errors , but nothing works. Is there any specific workaround for this case ?

TIA

Nilubkal avatar May 03 '22 10:05 Nilubkal

@jiasli for awareness

yonzhan avatar May 03 '22 10:05 yonzhan

I would like to do this: AZCLI=$(az --version|grep azure-cli) echo "$AZCLI" and get azure-cli 2.37.0 with out the extra crap. If I wanted the extra, I would be fine entering az --version --verbose.

sethbacon avatar May 30 '22 03:05 sethbacon

The recommended why to get the version for automation is using az version which shows versions in JSON:

> az version
{
  "azure-cli": "2.37.0",
  "azure-cli-core": "2.37.0",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {
    "ssh": "1.1.1"
  }
}

jiasli avatar May 30 '22 04:05 jiasli

There is indeed a switch to turn the survey links off:

https://github.com/Azure/azure-cli/blob/0d71b506a3242c51e6153c0b1eead64b7e698174/src/azure-cli-core/azure/cli/core/init.py#L127

https://github.com/Azure/azure-cli/blob/8264073bbec8424fc7329c5587c61725ef619880/src/azure-cli-core/azure/cli/core/_help.py#L174

We definitely should document it at https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration.

jiasli avatar May 30 '22 04:05 jiasli

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar May 30 '22 04:05 ghost

There is indeed a switch to turn the survey links off:

https://github.com/Azure/azure-cli/blob/0d71b506a3242c51e6153c0b1eead64b7e698174/src/azure-cli-core/azure/cli/core/init.py#L127

https://github.com/Azure/azure-cli/blob/8264073bbec8424fc7329c5587c61725ef619880/src/azure-cli-core/azure/cli/core/_help.py#L174

We definitely should document it at https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration.

FYI:

az config set output.show_survey_link=no

or

vi ~/.azure/config

[output]
show_survey_link = no

or

export AZURE_OUTPUT_SHOW_SURVEY_LINK=false

devteng avatar Jun 02 '22 12:06 devteng

@Nilubkal Apologies for the late reply. Thanks for reaching out to us and sharing this feedback. I just wanted to reconfirm if you have checked the above suggestions. Awaiting your reply.

navba-MSFT avatar Jun 17 '22 10:06 navba-MSFT

@Nilubkal I wanted to do quick follow-up to check if you had a chance to check the above suggestions and test. Please let us know if you need any further assistance on this. Awaiting your reply.

navba-MSFT avatar Jun 20 '22 04:06 navba-MSFT

Yes, it seems that the suggested solution works. This should be added tot the official documentation of az cli.
Thanks !

Nilubkal avatar Jun 20 '22 07:06 Nilubkal

@Nilubkal Thanks for getting back. The above PR has been filed to fix our documentation to include this command. Currently it is under review. In the meantime, if you have any questions, feel free to ask.

navba-MSFT avatar Jun 20 '22 09:06 navba-MSFT