Azure / azure-cli

Azure Command-Line Interface
MIT License
3.97k stars 2.95k forks source link

Running az purview does not install the extension as the documentation suggests #27862

Open neilmca-inc opened 10 months ago

neilmca-inc commented 10 months ago

Describe the bug

The documentation suggests....

This reference is part of the purview extension for the Azure CLI (version 2.15.0 or higher). The extension will automatically install the first time you run an az purview command. Learn more about extensions.

This isn't true, not of version 2.50.0 which is higher than the specificed 2.15.0 above - needs revisiting

PS C:\> az --version
azure-cli                         2.50.0 *

core                              2.50.0 *
telemetry                          1.0.8 *

Extensions:
application-insights              0.1.19
azure-devops                      0.26.0
k8s-extension                      1.4.3
kusto                              0.5.0
ml                                2.19.0
storage-preview                    0.9.0

Dependencies:
msal                              1.22.0
azure-mgmt-resource             23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\NeilMcAlister\.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

You have 3 update(s) available. Consider updating your CLI installation with 'az upgrade'
PS C:\> az purview
'purview' is misspelled or not recognized by the system.

Examples from AI knowledge base:
https://aka.ms/cli_ref
Read more about the command in reference docs

Related command

az --version az purview

Errors

'purview' is misspelled or not recognized by the system.

Issue script & Debug output

az --version az purview

Expected behavior

Installs as per documentation

Environment Summary

PS C:> az --version azure-cli 2.50.0 *

core 2.50.0 telemetry 1.0.8

Extensions: application-insights 0.1.19 azure-devops 0.26.0 k8s-extension 1.4.3 kusto 0.5.0 ml 2.19.0 storage-preview 0.9.0

Dependencies: msal 1.22.0 azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\NeilMcAlister.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Additional context

No response

azure-client-tools-bot-prd[bot] commented 10 months ago

Hi @neilmca-inc,

2.50.0 is not the latest Azure CLI(2.54.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 10 months ago

Thank you for opening this issue, we will look into it.

jsntcy commented 10 months ago

You need run az purview -h to install the extension. image

neilmca-inc commented 10 months ago

You need run az purview -h to install the extension. image

Thanks - I can confirm this works

Docs need updating to this

ghidalgo3 commented 7 months ago

In general, many pages of documentation for extensions say that the extension will install when you run a command but they don't specify that you must pass some argument to the command. See here for another example.

Personally I thought I was doing something wrong by running az network front-door and not getting an extension installation prompt. It would probably be bad to have the CLI make a network call every time the user tries an unknown extention, but having a list of known installable extensions and then showing them to the user when they attempt to use the extension would be a UX improvement.

Please don't close this issue, there is a UX problem here.

When a user runs az [group] [potential extension] with no arguments, they should get the same install prompt as if they ran az [group] [potential extension] -h.