Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

[BUG] Connecting using Managed Identity in Azure Runbook with Sites.Selected results in "The Push Notifications feature is not activated on the site" #4084

Open
1 task done
yvesrosius opened this issue Jul 10, 2024 · 3 comments
Labels
azure-automation Includes Azure Functions or Azure Runbooks bug Something isn't working managed-identity

Comments

@yvesrosius
Copy link

Reporting an Issue

Expected behavior

After setting up a managed identity, linked to an Azure Runbook using "Sites.Selected" instead of "Sites.FullControl.All", the Runbook should be able to connect to the sites granted permissions.

The Runbook should be able to perform cmdlets:

  • Get-PnPList
  • Get-PnPSite
  • ...

Actual behavior

Errors are thrown:

Steps to reproduce behavior

  1. Create Automation Account (+ Runbook)
  2. Enable system-assigned managed identity
  3. Add-PnPAzureADServicePrincipalAppRole -Principal "mymanagedidentity" -AppRole "Sites.Selected" -BuiltInType SharePointOnline
  4. Grant-PnPAzureADAppSitePermission -AppId "aa37b89e-75a7-47e3-bdb6-b763851c61b6" -DisplayName "TestApp" -Permissions FullControl -Site https://contoso.sharepoint.com/sites/somesite

image

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

2.5.0

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

  • Azure Automation Account (Azure Runbook) using Runtime Environment PowerShell 7.2
@yvesrosius yvesrosius added the bug Something isn't working label Jul 10, 2024
@yvesrosius
Copy link
Author

Just made some progress..

https://www.blimped.nl/running-application-with-limited-sharepoint-permissions/

This article mentions 2 steps to grant permissions to the application.

Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/project-x" -Interactive

$permission = Grant-PnPAzureADAppSitePermission -AppId "ce6bb9a7-c909-4538-b9dd-930724d7259d" -DisplayName "TestApp" -Permissions Write 

Set-PnPAzureADAppSitePermission -PermissionId $permission.Id -Permissions FullControl

Could you please update the documentation on this PnP article using Sites.Selected?

Other people are also running into this issue, as seen in #3219

@yvesrosius
Copy link
Author

Any update on this? Thanks :-)

@veronicageek veronicageek added azure-automation Includes Azure Functions or Azure Runbooks managed-identity labels Aug 20, 2024
@gautamdsheth
Copy link
Collaborator

@yvesrosius - is this still an issue ? 401 means there could an issue with your auth setup or maybe it isn't supported.

About the issue with Push notifications, that seems to be coming from server side , we can't do anything about that.
Maybe you can activate the feature like this and then execute your scripts ?

https://sharepoint.stackexchange.com/a/272473/8068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-automation Includes Azure Functions or Azure Runbooks bug Something isn't working managed-identity
Projects
None yet
Development

No branches or pull requests

3 participants