Priority
(Urgent) I can't use the CLI
Description
When you try to add a permission with admin consent to an Entra app, which doesn't have an enterprise app, the command fail with an error.
Steps to reproduce
- create a new app reg
- delete the associated enterprise app
m365 entra app permission add --appId some_app_id -d https://graph.microsoft.com/Tasks.Read --grantAdminConsent --debug
Expected results
Permission added with admin consent
Actual results
Error: Cannot read properties of undefined (reading 'id')
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
The issue is caused by us assuming in the code that there's a matching service principal:
|
await this.grantAdminConsent(appServicePrincipal!, appPermissions, logger); |
To fix this error, we should check if the service principal exists and create it if it doesn't to avoid the error.
Priority
(Urgent) I can't use the CLI
Description
When you try to add a permission with admin consent to an Entra app, which doesn't have an enterprise app, the command fail with an error.
Steps to reproduce
m365 entra app permission add --appId some_app_id -d https://graph.microsoft.com/Tasks.Read --grantAdminConsent --debugExpected results
Permission added with admin consent
Actual results
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
The issue is caused by us assuming in the code that there's a matching service principal:
cli-microsoft365/src/m365/entra/commands/app/app-permission-add.ts
Line 140 in c513557
To fix this error, we should check if the service principal exists and create it if it doesn't to avoid the error.