Access denied from azure devops pipeline to share point
Hello Team,
I'm getting below error when I'm trying to upload files from azure repos to sharepoint.
"statusCode":403,"code":"AccessDenied","requestId":"e0271c4b-c7aa-49bb-a55d-579a5f3e54ff","date":"2024-04-02T11:38:13.000Z","body":"{"code":"AccessDenied","message":"Either scp or roles claim need to be present in the token.","innerError":{"date":"2024-04-02T11:38:13","request-id":"e0271c4b-c7aa-49bb-a55d-579a5f3e54ff","client-request-id":"52f30db5-bb01-469a-73b3-3223de93a25d"}}"}
"statusCode":403,"code":"AccessDenied","requestId":"e0271c4b-c7aa-49bb-a55d-579a5f3e54ff","date":"2024-04-02T11:38:13.000Z","body":"{\"code\":\"AccessDenied\",\"message\":\"Either scp or roles claim need to be present in the token.\",\"innerError\":{\"date\":\"2024-04-02T11:38:13\",\"request-id\":\"e0271c4b-c7aa-49bb-a55d-579a5f3e54ff\",\"client-request-id\":\"52f30db5-bb01-469a-73b3-3223de93a25d\"}}"}
I am using Upload files to Sharepoint task in azure devops to perform this activity. I have created app registration in azure portal and added client,tenant and secret id in the pipeline task. Below are the permission i hve provided to the api in app registration.
Microsoft GRAPH API Directory.ReadWrite.All Directory.AccessAsUser.All User.ReadWrite.All Group.ReadWrite.All GroupMember.ReadWrite.All Sites.FullControl.All sites.read.all(application) user.read.all
SharePoint Online API AllSites.FullControl AllSites.Manage Sites.FullControl.All Sites.Search.All User.ReadWrite.All User.ReadWrite.All user.read.all