Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-PnPPlannerPlan Graph Permissions seems to be wrong in the docs (https://pnp.github.io/powershell/cmdlets/Get-PnPPlannerPlan.html) #3917

Open
1 of 6 tasks
kasperbolarsen opened this issue Apr 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@kasperbolarsen
Copy link

Reporting an Issue or Missing Feature

Issue

Expected behavior

In the https://pnp.github.io/powershell/cmdlets/Get-PnPPlannerPlan.html the required Graph permissions are:
Required Permissions
Microsoft Graph API: Group.ReadWrite.All
Microsoft Graph API: Group.Read.All

Actual behavior

However, when I run
$allPlannerPlansInGroup = Get-PnPPlannerPlan -Group $groupId -Connection $conn -erroraction stop
in an Http triggered Azure Function (usingManaged Identity)
I get a Graph Exception

Steps to reproduce behavior

Adding Tasks.ReadWrite.All permission to my managed Identity and it works
image

remove the Tasks.ReadWrite.All permission and wait awhile and the exception pops up again.

What is the version of the Cmdlet module you are running?

2.4.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

I am not sure how to verify if this is a fluke and only is an issue when using Managed Identity in an Azure Function?

@kasperbolarsen kasperbolarsen added the bug Something isn't working label Apr 26, 2024
@jackpoz
Copy link
Contributor

jackpoz commented Apr 26, 2024

Planner used to support only delegated permissions, with application permissions being added in October 2022 https://devblogs.microsoft.com/microsoft365dev/announcing-updates-to-the-planner-api-in-microsoft-graph/ .

These are the new permissions (from https://learn.microsoft.com/en-us/graph/api/plannerplan-get?view=graph-rest-1.0&tabs=http#permissions )

Permission type Least privileged permissions Higher privileged permissions
Delegated Tasks.Read Tasks.ReadWrite, Group.Read.All, Group.ReadWrite.All
Application Tasks.Read.All Tasks.ReadWrite.All

Managed identity counts as Application, so that's why it's throwing that error.

A bit unsure if

[RequiredMinimalApiPermissions("Group.Read.All")]
should be changed to "Tasks.Read" or "Tasks.Read.All" , as the permissions are different depending on Delegated and Application.

@kasperbolarsen
Copy link
Author

I would say both, or replacing the current with a link to https://learn.microsoft.com/en-us/graph/api/plannerplan-get?view=graph-rest-1.0&tabs=http#permissions as the current info is wrong and might cause problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants