Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.97k forks source link

`az ad add credential reset`'s document shouldn't include `--subscription` argument #23412

Open roycornelissen opened 2 years ago

roycornelissen commented 2 years ago

The command az ad add credential reset does not support global parameter --subscription, even though it's mentioned in the docs.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

yonzhan commented 2 years ago

@jiasli for awareness

jiasli commented 2 years ago

This seems to be a bug in document generation.

--subscription argument was ignored for all az ad commands:

https://github.com/Azure/azure-cli/blob/33cbd01f75c7d4c3814de5a1cbf6f42de7890467/src/azure-cli/azure/cli/command_modules/role/_params.py#L26-L27

The in-tool help doesn't show --subscription:

> az ad app credential reset -h

Command
    az ad app credential reset : Append or overwrite an application's password or certificate
    credentials.
        By default, this command clears all passwords and keys, and let graph service generate a
        password credential.

        The output includes credentials that you must protect. Be sure that you do not include these
        credentials in your code or check the credentials into your source control. As an
        alternative, consider using [managed identities](https://aka.ms/azadsp-managed-identities)
        if available to avoid the need to use credentials.

Arguments
    --id    [Required] : Identifier uri, application id, or object id.
    --append           : Append the new credential instead of overwriting.
    --display-name     : Friendly name for the password or key.

Credential Arguments
    --cert             : Certificate to use for credentials.
    --years            : Number of years for which the credentials will be valid.

keyCredentials Arguments
    --create-cert      : Create a self-signed certificate to use for the credential.
    --end-date         : Date or datetime after which credentials expire (e.g.
                         '2017-12-31T11:59:59+00:00' or '2017-12-31'). Default value is one year
                         after current time.
    --keyvault         : Name or ID of a KeyVault to use for creating or retrieving certificates.

Global Arguments
    --debug            : Increase logging verbosity to show all debug logs.
    --help -h          : Show this help message and exit.
    --only-show-errors : Only show errors, suppressing warnings.
    --output -o        : Output format.  Allowed values: json, jsonc, none, table, tsv, yaml, yamlc.
                         Default: json.
    --query            : JMESPath query string. See http://jmespath.org/ for more information and
                         examples.
    --verbose          : Increase logging verbosity. Use --debug for full debug logs.