Skip to content

Bug report: entra app permission remove doesn't fail validation on invalid scope #6109

@waldekmastykarz

Description

@waldekmastykarz

Priority

(Medium) I'm annoyed but I'll live

Description

The entra app permission remove command doesn't fail when you pass an unqualified scope (eg. User.Read instead of https://graph.microsoft.com/User.Read). The code assumes that the scope is qualified but we don't check it in the validation stage. As a result, the command fails with a vague error: Service principal not found (notice the double space caused by the command being unable to resolve the service principal from the scope, because it's not qualified)

Steps to reproduce

m365 entra app permission remove --appId some_guid -d User.Read --force

Expected results

Validation error: User.Read is not a valid scope

Actual results

Service principal not found

Diagnostics

No response

CLI for Microsoft 365 version

latest from main

nodejs version

v20

Operating system (environment)

macOS

Shell

zsh

cli doctor

No response

Additional Info

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions