You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AudienceUriValidationFailedException from Invoke-PnPSPRestMethod when using this cmdlet in an Azure Runbook
Expected behavior
The REST-Method should succeed
Actual behavior
Getting error:
{"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."}
Steps to reproduce behavior
Automation-Account has System-Identity
Related App-Registration has Sites.FullControl.All and User.ReadWrite.All for Graph and SharePoint
App-reg has a valid certificate and a valid Secret.
I have added App-Only (ACS) for this App-Reg at the admin site: https://mytenant-admin.sharepoint.com
@EA12 - have you tried using Set-PnPUserProfileProperty cmdlet , should work the same way ? Looks like an issue with the API itself , so not sure if we can do anything here.
Reporting an Issue
AudienceUriValidationFailedException from Invoke-PnPSPRestMethod when using this cmdlet in an Azure Runbook
Expected behavior
The REST-Method should succeed
Actual behavior
Getting error:
{"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."}
Steps to reproduce behavior
Automation-Account has System-Identity
Related App-Registration has Sites.FullControl.All and User.ReadWrite.All for Graph and SharePoint
App-reg has a valid certificate and a valid Secret.
I have added App-Only (ACS) for this App-Reg at the admin site: https://mytenant-admin.sharepoint.com
Connecting:
$cnn = Connect-PnPOnline -Url $adminUrl -ClientId $clientId -ClientSecret $clientSecret -ReturnConnection
The API to use (to assign a UPS-Property)
$url = "https://mytenant.sharepoint.com/_api/SP.UserProfiles.PeopleManager/SetSingleValueProfileProperty"
Calling Invoke-PnPSPRestMethod throws the error:
$response = Invoke-PnPSPRestMethod -Url $url -Connection $cnn -Method 'POST' -ContentType 'application/json;odata=nometadata' -Content $Body
I couldn't find a code file here on github for Invoke-PnPSPRestMethod, just a documentation and an incomplete test.
What is the version of the Cmdlet module you are running?
My script is running in an azure runbook with PowerShell-runtime 5.1 and PnP.PowerShell 1.9.59
Which operating system/environment are you running PnP PowerShell on?
The text was updated successfully, but these errors were encountered: