Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access denied when Upload files from repo to SharePoint Online Library #12

Open
Sharukh-maker opened this issue Jul 13, 2023 · 4 comments

Comments

@Sharukh-maker
Copy link

Sharukh-maker commented Jul 13, 2023

Which significant should we used here for azure pipeline,I am not able to understand why i am getting this error.
When I am trying to upload files from repository to Sharepoint document library then it will shown an error.I am global admin where i want to upload files in sharepoint library.
Please check and let me know.

{"statusCode":403,"code":"AccessDenied","requestId":"89456c3f-9482-4f6f-bf1e-37be127c432c","date":"2023-07-13T08:14:24.000Z","body":"{"code":"AccessDenied","message":"Either scp or roles claim need to be present in the token.","innerError":{"date":"2023-07-13T08:14:24","request-id":"89456c3f-9482-4f6f-bf1e-37be127c432c","client-request-id":"e116f805-6b39-40ee-7ef4-686b4fadd860"}}"}Upload files to SharePoint: Testdoc    
 
Could not validate drive id.Upload files to SharePoint: Testdoc
@JumpingJezza
Copy link

I had this exact problem. It took me a while to realise I had forgotten to grant admin consent for the api permission.
image

@ayoubqrt
Copy link

ayoubqrt commented Jan 4, 2024

@JumpingJezza Did you follow this tutorial https://www.leonarmston.com/2022/02/use-sites-selected-permission-with-fullcontrol-rather-than-write-or-read/ or you have another useful resource to grant the app to full control on a particular site collection ?

I followed this tutorial, granted admin consent fot the Sites.Selected api, and I have the same error as @Sharukh-maker .
But if I use Files.ReadWrite.All, of course it's working.
Any ideas ? @halliba

@JumpingJezza
Copy link

@ayoubqrt I did see that tutorial, but the read.me was more useful: https://github.com/halliba/az-pipelines-2-sharepoint

@Palanikr
Copy link

Palanikr commented Apr 2, 2024

@Sharukh-maker Is it working now? Have you added sites.selected permission to sharepoint in azure app registration portal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants