Skip to content

Bug report: "Error: The operation 'read' on resource type 'XXX' is disallowed" returned by certain commands #3207

@wilecoyotegenius

Description

@wilecoyotegenius

Description

I am not sure whether this is an issue or some sort of misconfiguration on my side.

I have just installed 5.1.0 version of the CLI and I am experiencing issues when running certain commands, mostly related to PowerPlatform.

Commands return following error messages:
Error: The operation 'read' on resource type 'XXX' is disallowed.
where XXX is either environments or apis, depending on a resource related to the command.

I used CLI in the past (about a half a year ago) and used the same commands I try now and they were working fine.
I tried reverting to previous versions of the CLI (4.4.0), tried reconsenting (m365 cli reconsent) and registering management app for PowerPlatform (m365 pp managementapp add with options as described on command's reference page) with no success.

Did I miss an additional configuration step somewhere? It is weird, as it worked for me in the past without having to configure anything.

Steps to reproduce

Install CLI
npm i -g @pnp/cli-microsoft365

Log into M365 CLI
m365 login

Get environments
m365 pa environment list

Get custom connectors
m365 pa connector list --environment <environment>

Expected results

Returns list of environments or connectors

Actual results

Error: The operation 'read' on resource type 'environments' is disallowed. for m365 pa environment list

Error: The operation 'read' on resource type 'apis' is disallowed. for m365 pa connector list --environment <environment>

Diagnostics

No response

CLI for Microsoft 365 version

5.1.0

nodejs version

v14.18.1

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

{
"os": {
"platform": "win32",
"version": "Windows 10 Pro",
"release": "10.0.19044"
},
"cliVersion": "5.1.0",
"nodeVersion": "v14.18.1",
"cliAadAppId": "31359c7f-bd7e-475c-86db-fdb8c937548e",
"cliAadAppTenant": "common",
"authMode": "DeviceCode",
"cliEnvironment": "",
"cliConfig": {},
"roles": [],
"scopes": [
"AllSites.FullControl",
"AppCatalog.ReadWrite.All",
"ChannelMember.ReadWrite.All",
"ChannelMessage.Read.All",
"ChannelMessage.Send",
"ChannelSettings.ReadWrite.All",
"Chat.Read",
"Chat.ReadWrite",
"Directory.AccessAsUser.All",
"Directory.ReadWrite.All",
"Group.ReadWrite.All",
"IdentityProvider.ReadWrite.All",
"Mail.ReadWrite",
"Mail.Send",
"Place.Read.All",
"Policy.Read.All",
"Reports.Read.All",
"ServiceHealth.Read.All",
"ServiceMessage.Read.All",
"ServiceMessageViewpoint.Write",
"Tasks.ReadWrite",
"Team.Create",
"TeamMember.ReadWrite.All",
"TeamsApp.ReadWrite.All",
"TeamsAppInstallation.ReadWriteForUser",
"TeamSettings.ReadWrite.All",
"TeamsTab.ReadWrite.All",
"TermStore.ReadWrite.All",
"User.Invite.All",
"User.Read.All",
"User.ReadWrite.All",
"profile",
"openid",
"email",
"user_impersonation"
]
}

Additional Info

No response

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions