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

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

Open roycornelissen opened this issue 3 years ago • 2 comments

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.

roycornelissen avatar Aug 02 '22 10:08 roycornelissen

@jiasli for awareness

yonzhan avatar Aug 02 '22 10:08 yonzhan

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.

jiasli avatar Aug 02 '22 16:08 jiasli