[BUG?] Add-PnPGroupMember fails using Managed Identity in Azure Runbook #3940
Unanswered
dement-construction
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've run into some strange behavior. I have a script that creates a SharePoint (online) site, adds some AD security groups to the Site's SharePoint groups, adds some folders and sets permissions on them etc. This script would work fine on my workstation but would fail when running in an Azure Runbook using a managed identity. Specifically, adding the AD security groups to the SharePoint groups would fail.
At first I thought this was a bug in Add-PnPGroupMember. But on further investigation I found that the built-in SharePoint group names are different when the script is run locally versus on the runbook.
For example, if my site name was "This Is a Test Site" then the Owners group on my local workstation would be "This Is a Test Site Owners". That same group's name when accessed in the Runbook would be just "Site Owners" I was building my SharePoint group names by using the site title and adding " Owners" "Visitors" or " Members" to the end, so this would fail when run on the Runbook.
So I moved to grabbing the group names using the "associated" options and now it works both locally and under the Runbook:
So this is working for me now, but it still seems weird. Has anyone else seen this behavior?
Beta Was this translation helpful? Give feedback.
All reactions