Skip to content

logger.warning() doesnt mention required scope argument for granting permission #25982

@pamelafox

Description

@pamelafox

Describe the bug

The warning in the console gives a command that doesn't work without additional arguments.

Command Name
az ad app permission add

Errors:

The output says:
"Invoking az ad app permission grant --id {}--api 00000003-0000-0000-c000-000000000000 is needed to make the change effective"

However, if you run that, you'll get an error due to missing argument:

$ az ad app permission grant --id $client_id \
    --api 00000003-0000-0000-c000-000000000000
the following arguments are required: --scope

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Create an app registration
  • az ad app permission add --id {} --api {} --api-permissions {}

Expected Behavior

I expect it to give me a working command or at least to mention scope is needed.

Environment Summary

Linux-5.15.49-linuxkit-x86_64-with-glibc2.31, Debian GNU/Linux 11 (bullseye)
Python 3.10.10
Installer: DEB

azure-cli 2.46.0

Extensions:
account 0.2.5

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Additional Context

The line of code generating the warning is

logger.warning('Invoking `az ad app permission grant --id %s --api %s` is needed to make the '

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamGraph(doesn't work with label-triggered comments; use Graph.Microsoft instead) az adact-identity-squadquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions