1

I'm trying to automate the creation of a TermStore term and apply a simple navigation link. I finally got my Azure Function to connect to SPO and query data, but when I use the New-PnPTerm command below, I get an access denied error.

Connect-PnPOnline -ClientId $appId -Thumbprint $thumbPrint –Url https://<tenant>-admin.sharepoint.com -Tenant <tenant>.onmicrosoft.com
New-PnPTerm -TermSet <termset> -TermGroup "Navigation" -Name $item.FieldValues.Title -LocalCustomProperties @{"_Sys_Nav_SimpleLinkUrl"="$($item.FieldValues.SharePointURL)"} 

[Error] ERROR: Access denied. You do not have permission to perform this action or access this resource

My Azure Function uses a certificate to authenticate via the Azure AD app registration, which has the following API permissions:

  • Graph.Group.ReadWrite.All
  • Graph.TermStore.ReadWrite.All
  • Graph.User.ReadWrite.All
  • SharePoint.AllSites.FullControl
  • SharePoint.Sites.FullControl.All
  • SharePoint.TermStore.ReadWrite.All
  • SharePoint.User.ReadWrite.All

Even better would be if this can be done in a Logic App. I wasn't able to find a connector or REST endpoint that would support this. Thanks in advance for any advice.

1 Answer 1

1

Azure App Registration and Term Store: Solution for Access Denied

Navigate to the term store admin center, and add app@sharepoint as a term store admin.

enter image description here

1
  • 1
    Thanks, Denis. That took care of my auth issue.
    – Jason
    Mar 30, 2021 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.