Forum Discussion
Sudharsan K
Mar 16, 2020Iron Contributor
Set-PnPUserProfileProperty with Application Permission in Azure Function
When using Set-PnPUserProfileProperty in Azure Function with Power Shell and the permissions has been defined using the Application Permission. Once connected to the admin site URL using client id, t...
RonLevy
Sep 28, 2023Brass Contributor
I run into the samme issue from an Azure Runbook.
I added a Secret to my App-Reg and added App-Only (ACS) for that App-Reg (addinv.aspx on admin-site). I added Sites.FullControl.All and User.ReadWrite.All for Graph and SharePoint to the API-Permissions of my App-Reg.
I then connected to the admin-site by client-id of my App-Reg and the secret:
Connect-PnPOnline -Url $adminUrl -ClientId $clientId -ClientSecret $clientSecret
With that, i was able to update the ups property.
Set-PnPUserProfileProperty -Account $UserAccount -PropertyName "SBU" -Value $sbu
May you can adapt the settings. Or this may help others...
I added a Secret to my App-Reg and added App-Only (ACS) for that App-Reg (addinv.aspx on admin-site). I added Sites.FullControl.All and User.ReadWrite.All for Graph and SharePoint to the API-Permissions of my App-Reg.
I then connected to the admin-site by client-id of my App-Reg and the secret:
Connect-PnPOnline -Url $adminUrl -ClientId $clientId -ClientSecret $clientSecret
With that, i was able to update the ups property.
Set-PnPUserProfileProperty -Account $UserAccount -PropertyName "SBU" -Value $sbu
May you can adapt the settings. Or this may help others...